Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and document testing #84

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ test-pub-%:
.PHONY: test-draft-jats test-draft-preprint test-draft-%
test-draft-jats:
$(INARA_TEST_CMD) -o jats example/paper.md
diff test/expected-paper.jats/paper.jats example/jats/paper.jats
diff test/expected-draft/paper.jats/paper.jats example/jats/paper.jats
test-draft-preprint: GOLDEN_FILE = paper.preprint.tex
test-draft-%: GOLDEN_FILE = paper.$*
test-draft-%:
$(INARA_TEST_CMD) -o $* example/paper.md
diff test/expected-$(GOLDEN_FILE) example/$(GOLDEN_FILE)
diff test/expected-draft/$(GOLDEN_FILE) example/$(GOLDEN_FILE)

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

.PHONY: validate-jats
validate-jats: test/expected-paper.jats/paper.jats \
validate-jats: test/expected-draft/paper.jats/paper.jats \
test/JATS-journalpublishing1.xsd
xmllint --schema test/JATS-journalpublishing1.xsd $< --noout
22 changes: 22 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Testing

Testing in Inara works by checking both the _draft_ mode and
_production_ mode (i.e., compiled with `-p`) for the following artifacts
using the `diff` command:

1. JATS XML (`jats`)
2. Crossref XML (`crossref`)
3. Preprint LaTeX (`preprint`)
4. PDF (`pdf`), though note this is a binary comparison

The _draft_ golden standard files are in the [expected-draft](expected-draft) folder while
the _production_ golden standard files are in the [expected-pub](expected-pub) folder.

## Maintaining the Golden Standard Files

If you make updates to the underlying [paper.md](../example/paper.md) file in the `/examples`
folder, you'll need to update at minimum the preprint and PDF. If you update the metadata
in the `paper.md` or make changes to the templates, you might also have to update the JATS
and Crossref XML files.

**How to update the golden standard files** - TBA
File renamed without changes.
File renamed without changes.
Loading