From 1f1125e63a89e75d7196565326b451af42595f9a Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 11 Sep 2024 09:19:32 +0200 Subject: [PATCH 1/3] Refactor and document testing --- Makefile | 6 +++--- test/README.md | 10 ++++++++++ .../paper.crossref} | 0 .../paper.jats}/paper.jats | 0 .../paper.pdf} | Bin .../paper.preprint.tex} | 0 6 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 test/README.md rename test/{expected-paper.crossref => expected-draft/paper.crossref} (100%) rename test/{expected-paper.jats => expected-draft/paper.jats}/paper.jats (100%) rename test/{expected-paper.pdf => expected-draft/paper.pdf} (100%) rename test/{expected-paper.preprint.tex => expected-draft/paper.preprint.tex} (100%) diff --git a/Makefile b/Makefile index 656da74..cc8b683 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -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 diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..dfa34e6 --- /dev/null +++ b/test/README.md @@ -0,0 +1,10 @@ +# 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 diff --git a/test/expected-paper.crossref b/test/expected-draft/paper.crossref similarity index 100% rename from test/expected-paper.crossref rename to test/expected-draft/paper.crossref diff --git a/test/expected-paper.jats/paper.jats b/test/expected-draft/paper.jats/paper.jats similarity index 100% rename from test/expected-paper.jats/paper.jats rename to test/expected-draft/paper.jats/paper.jats diff --git a/test/expected-paper.pdf b/test/expected-draft/paper.pdf similarity index 100% rename from test/expected-paper.pdf rename to test/expected-draft/paper.pdf diff --git a/test/expected-paper.preprint.tex b/test/expected-draft/paper.preprint.tex similarity index 100% rename from test/expected-paper.preprint.tex rename to test/expected-draft/paper.preprint.tex From 61583753297f259825d1772fb932929ad78d0692 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 11 Sep 2024 09:36:41 +0200 Subject: [PATCH 2/3] Update README.md --- test/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/README.md b/test/README.md index dfa34e6..c451f9a 100644 --- a/test/README.md +++ b/test/README.md @@ -8,3 +8,11 @@ using the `diff` command: 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. + +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. From 4edc083e33315ff6e4c21ee7b19fc91afd8fcefb Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 11 Sep 2024 09:37:07 +0200 Subject: [PATCH 3/3] Update README.md --- test/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/README.md b/test/README.md index c451f9a..9355417 100644 --- a/test/README.md +++ b/test/README.md @@ -12,7 +12,11 @@ using the `diff` command: 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