Skip to content

Commit f5f806b

Browse files
authored
Refactor and document testing (#84)
1 parent f24c9a2 commit f5f806b

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ test-pub-%:
122122
.PHONY: test-draft-jats test-draft-preprint test-draft-%
123123
test-draft-jats:
124124
$(INARA_TEST_CMD) -o jats example/paper.md
125-
diff test/expected-paper.jats/paper.jats example/jats/paper.jats
125+
diff test/expected-draft/paper.jats/paper.jats example/jats/paper.jats
126126
test-draft-preprint: GOLDEN_FILE = paper.preprint.tex
127127
test-draft-%: GOLDEN_FILE = paper.$*
128128
test-draft-%:
129129
$(INARA_TEST_CMD) -o $* example/paper.md
130-
diff test/expected-$(GOLDEN_FILE) example/$(GOLDEN_FILE)
130+
diff test/expected-draft/$(GOLDEN_FILE) example/$(GOLDEN_FILE)
131131

132132
NCBI_FTP = "ftp://ftp.ncbi.nih.gov/pub/jats/publishing/1.2/xsd/"
133133
test/JATS-Publishing-1-2-MathML2-XSD.zip:
@@ -141,6 +141,6 @@ test/JATS-journalpublishing1.xsd: \
141141
rm -rf /tmp/JATS-Publishing-1-2-MathML2-XSD
142142

143143
.PHONY: validate-jats
144-
validate-jats: test/expected-paper.jats/paper.jats \
144+
validate-jats: test/expected-draft/paper.jats/paper.jats \
145145
test/JATS-journalpublishing1.xsd
146146
xmllint --schema test/JATS-journalpublishing1.xsd $< --noout

test/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Testing
2+
3+
Testing in Inara works by checking both the _draft_ mode and
4+
_production_ mode (i.e., compiled with `-p`) for the following artifacts
5+
using the `diff` command:
6+
7+
1. JATS XML (`jats`)
8+
2. Crossref XML (`crossref`)
9+
3. Preprint LaTeX (`preprint`)
10+
4. PDF (`pdf`), though note this is a binary comparison
11+
12+
The _draft_ golden standard files are in the [expected-draft](expected-draft) folder while
13+
the _production_ golden standard files are in the [expected-pub](expected-pub) folder.
14+
15+
## Maintaining the Golden Standard Files
16+
17+
If you make updates to the underlying [paper.md](../example/paper.md) file in the `/examples`
18+
folder, you'll need to update at minimum the preprint and PDF. If you update the metadata
19+
in the `paper.md` or make changes to the templates, you might also have to update the JATS
20+
and Crossref XML files.
21+
22+
**How to update the golden standard files** - TBA
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)