Skip to content

Commit

Permalink
Add golden tests for publishing artifacts
Browse files Browse the repository at this point in the history
Closes: #58
  • Loading branch information
tarleb committed May 31, 2024
1 parent f1c5161 commit 8350ae7
Show file tree
Hide file tree
Showing 6 changed files with 1,743 additions and 9 deletions.
35 changes: 26 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,32 @@ INARA_TEST_CMD = docker run --rm \
--env SOURCE_DATE_EPOCH=1234567890 \
-v $${PWD}:/data openjournals/inara:latest

.PHONY: test test-golden test-jats test-%
test: test-golden

test-golden: test-crossref test-jats test-pdf test-preprint

test-jats: GOLDEN_FILE = paper.jats/paper.jats
test-preprint: GOLDEN_FILE = paper.preprint.tex
test-%: GOLDEN_FILE = paper.$*
test-%:
.PHONY: test test-golden-draft test-golden-pub
test: test-golden-draft test-golden-pub
test-golden-draft: \
test-draft-crossref \
test-draft-jats \
test-draft-pdf \
test-draft-preprint
test-golden-pub: \
test-pub-crossref \
test-pub-jats \
test-pub-pdf \
test-pub-preprint

.PHONY: test-pub-jats test-pub-preprint test-pub-%
test-pub-jats: GOLDEN_FILE = paper.jats/paper.jats
test-pub-preprint: GOLDEN_FILE = paper.preprint.tex
test-pub-%: GOLDEN_FILE = paper.$*
test-pub-%:
$(INARA_TEST_CMD) -m test/metadata.yaml -o $* example/paper.md -p
diff example/$(GOLDEN_FILE) test/expected-pub/$(GOLDEN_FILE)

.PHONY: test-draft-jats test-draft-preprint test-draft-%
test-draft-jats: GOLDEN_FILE = paper.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 example/$(GOLDEN_FILE) test/expected-$(GOLDEN_FILE)

Expand Down
167 changes: 167 additions & 0 deletions test/expected-pub/paper.crossref
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<doi_batch xmlns="http://www.crossref.org/schema/5.3.1"
xmlns:ai="http://www.crossref.org/AccessIndicators.xsd"
xmlns:rel="http://www.crossref.org/relations.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="5.3.1"
xsi:schemaLocation="http://www.crossref.org/schema/5.3.1 http://www.crossref.org/schemas/crossref5.3.1.xsd">
<head>
<doi_batch_id>20090213233130-7df7772968726f2a3c347b21a6d3257f38f7c870</doi_batch_id>
<timestamp>20090213233130</timestamp>
<depositor>
<depositor_name>JOSS Admin</depositor_name>
<email_address>[email protected]</email_address>
</depositor>
<registrant>The Open Journal</registrant>
</head>
<body>
<journal>
<journal_metadata>
<full_title>Journal of Open Source Software</full_title>
<abbrev_title>JOSS</abbrev_title>
<issn media_type="electronic">2475-9066</issn>
<doi_data>
<doi>10.21105/joss</doi>
<resource>https://joss.theoj.org</resource>
</doi_data>
</journal_metadata>
<journal_issue>
<publication_date media_type="online">
<month>05</month>
<year>2020</year>
</publication_date>
<journal_volume>
<volume>0</volume>
</journal_volume>
<issue>5</issue>
</journal_issue>
<journal_article publication_type="full_text">
<titles>
<title>Article Writing with Markdown and the Open Journals
publishing pipeline</title>
</titles>
<contributors>
<person_name sequence="first" contributor_role="author">
<given_name>Albert</given_name>
<surname>Krewinkel</surname>
<ORCID>https://orcid.org/0000-0002-9455-0796</ORCID>
</person_name>
<person_name sequence="additional"
contributor_role="author">
<given_name>Juanjo</given_name>
<surname>Bazán</surname>
<ORCID>https://orcid.org/0000-0001-7699-3983</ORCID>
</person_name>
<person_name sequence="additional"
contributor_role="author">
<given_name>Arfon M.</given_name>
<surname>Smith</surname>
<ORCID>https://orcid.org/0000-0002-3957-2474</ORCID>
</person_name>
</contributors>
<publication_date>
<month>05</month>
<day>23</day>
<year>2020</year>
</publication_date>
<pages>
<first_page>00000</first_page>
</pages>
<publisher_item>
<identifier id_type="doi">10.21105/joss.00000</identifier>
</publisher_item>
<ai:program name="AccessIndicators">
<ai:license_ref applies_to="vor">http://creativecommons.org/licenses/by/4.0/</ai:license_ref>
<ai:license_ref applies_to="am">http://creativecommons.org/licenses/by/4.0/</ai:license_ref>
<ai:license_ref applies_to="tdm">http://creativecommons.org/licenses/by/4.0/</ai:license_ref>
</ai:program>
<rel:program>
<rel:related_item>
<rel:description>Software archive</rel:description>
<rel:inter_work_relation relationship-type="references" identifier-type="doi">10.5281/zenodo.00000000</rel:inter_work_relation>
</rel:related_item>
<rel:related_item>
<rel:description>GitHub review issue</rel:description>
<rel:inter_work_relation relationship-type="hasReview" identifier-type="uri">https://github.com/openjournals/inara/issues</rel:inter_work_relation>
</rel:related_item>
</rel:program>
<doi_data>
<doi>10.21105/joss.00000</doi>
<resource>https://joss.theoj.org/papers/10.21105/joss.00000</resource>
<collection property="text-mining">
<item>
<resource mime_type="application/pdf">https://joss.theoj.org/papers/10.21105/joss.00000.pdf</resource>
</item>
</collection>
</doi_data>
<citation_list>
<citation key="upper1974">
<article_title>The unsuccessful self-treatment of a case of
"writer’s block"</article_title>
<author>Upper</author>
<journal_title>Journal of Applied Behavior
Analysis</journal_title>
<issue>3</issue>
<volume>7</volume>
<doi>10.1901/jaba.1974.7-497a</doi>
<issn>0021-8855</issn>
<cYear>1974</cYear>
<unstructured_citation>Upper, D. (1974). The unsuccessful
self-treatment of a case of "writer’s block". Journal of Applied
Behavior Analysis, 7(3), 497.
https://doi.org/10.1901/jaba.1974.7-497a</unstructured_citation>
</citation>
<citation key="smith2018">
<article_title>Journal of open source software (JOSS):
Design and first-year review</article_title>
<author>Smith</author>
<journal_title>PeerJ Computer Science</journal_title>
<volume>4</volume>
<doi>10.7717/peerj-cs.147</doi>
<issn>2376-5992</issn>
<cYear>2018</cYear>
<unstructured_citation>Smith, A. M., Niemeyer, K. E., Katz,
D. S., Barba, L. A., Githinji, G., Gymrek, M., Huff, K. D., Madan, C.
R., Cabunoc Mayes, A., Moerman, K. M., Prins, P., Ram, K., Rokem, A.,
Teal, T. K., Valls Guimera, R., &amp; Vanderplas, J. T. (2018). Journal
of open source software (JOSS): Design and first-year review. PeerJ
Computer Science, 4, e147.
https://doi.org/10.7717/peerj-cs.147</unstructured_citation>
</citation>
<citation key="krewinkel2017">
<article_title>Formatting open science: Agilely creating
multiple document formats for academic manuscripts with pandoc
scholar</article_title>
<author>Krewinkel</author>
<journal_title>PeerJ Computer Science</journal_title>
<volume>3</volume>
<doi>10.7717/peerj-cs.112</doi>
<issn>2376-5992</issn>
<cYear>2017</cYear>
<unstructured_citation>Krewinkel, A., &amp; Winkler, R.
(2017). Formatting open science: Agilely creating multiple document
formats for academic manuscripts with pandoc scholar. PeerJ Computer
Science, 3, e112.
https://doi.org/10.7717/peerj-cs.112</unstructured_citation>
</citation>
<citation key="yaml_website">
<article_title>The Official YAML Web Site</article_title>
<cYear>2022</cYear>
<unstructured_citation>The Official YAML Web Site. (2022,
April 19). https://yaml.org/</unstructured_citation>
</citation>
<citation key="pdfa3">
<article_title>Document management – electronic document
file format for long-term preservation – part 3: Use of ISO 32000-1 with
support for embedded files (PDF/A-3)</article_title>
<cYear>2012</cYear>
<unstructured_citation>Document management – electronic
document file format for long-term preservation – part 3: Use of ISO
32000-1 with support for embedded files (PDF/A-3). (2012). [Standard].
International Organization for Standardization.</unstructured_citation>
</citation>
</citation_list>
</journal_article>
</journal>
</body>
</doi_batch>
Loading

0 comments on commit 8350ae7

Please sign in to comment.