test: read the test nanopublications from the nanopub test suite - #666
Merged
Conversation
Nanopublications used as fixtures belong in the nanopub test suite, where every implementation reads them from, rather than being copied into each consumer. #619 did that for the grlc query template it needed; this is the rest of them (#620), and they were not all the same kind of thing: np-grlc-query.trig Pure duplication: byte-identical to valid/signed/RA6T-....trig in the suite already. Deleted, and GrlcQueryTest and NanopubElementTest read it from there. np-statusline-example.trig A published, signed, trusty retraction, so it belongs in the suite's valid/signed alongside the others: Nanopublication/nanopub-testsuite#6, since merged. Deleted here, and StatusLineTest reads it from the suite. np-governed-definition.trig, np-nongoverned-definition.trig Kept here. They are hand-built, unsigned and carry placeholder artifact codes, because they exist to exercise Nanodash's own governance logic rather than to test whether an implementation reads nanopublications correctly; a suite for validating implementations is not their home, and an unsigned nanopub with a made-up code has no business in its valid/ folder. Said so where they are loaded, so the question isn't reopened. templates/new-style-assertion-template.trig Deleted: no test referenced it. If it was meant for a test that never landed, it should come back with that test, from the suite. Each test resolves its fixture through the connector by artifact code, the way SparqlPlaceholderValidationTest already did, rather than through a wrapper of our own. A fixture that isn't there fails rather than skips: it would mean the entry has been renamed or removed, and the test is no longer testing what it says it is. The connector downloads the suite once per JVM, so several fixtures cost one download. Full test run: 1232 tests, 0 failures, no new skips. Closes #620 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014dByNErNfuj4au4r5vMsbf
ashleycaselli
force-pushed
the
620-test-nanopubs-to-suite
branch
from
August 31, 2026 08:28
e6a0798 to
72f3505
Compare
The check against the real "Defining a grlc query" template was written while its test-suite entry was still a pending pull request, so it skipped when the entry was missing (Nanopublication/nanopub-testsuite#5). That merged on 2026-08-20, and the guard has been dead weight since: its own comment says the test "fails rather than quietly skipping" if a later version of the template moves the SPARQL field, which was not true while an absent entry took the test out of the run instead. Now a missing entry throws, like the other suite fixtures read in this tree (#620): it would mean the entry has been renamed or removed, and the test is no longer testing what it says it is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014dByNErNfuj4au4r5vMsbf
ashleycaselli
force-pushed
the
620-test-nanopubs-to-suite
branch
from
August 31, 2026 09:23
805245d to
80f7ce4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #620.
Nanopublications used as fixtures belong in the nanopub test suite, where every implementation reads them from, rather than being copied into each consumer. #619 did that for the grlc query template it needed; this is the rest of them. They were not all the same kind of thing, so it is not one move repeated five times:
np-grlc-query.trigvalid/signed/RA6T-….trigthere already — pure duplication.GrlcQueryTestandNanopubElementTestrepointed.np-statusline-example.trigvalid/signed/RA58Ycj….trig: Nanopublication/nanopub-testsuite#6, since merged.StatusLineTestreads it from there.np-governed-definition.trignp-nongoverned-definition.trigtemplates/new-style-assertion-template.trigThe two governance fixtures stay
Item 3 of the issue asked for a decision rather than an assumption, and the decision is that they stay in this repository. They are hand-built, unsigned, and carry placeholder artifact codes (
RAAAA…,RABBB…) because they exist to exercise Nanodash's own governance logic —GovernedVersions.findGovernedRef— not to test whether an implementation reads nanopublications correctly. A suite whose stated purpose is validating nanopub implementations is not their home, and an unsigned nanopub with a made-up code has no business in itsvalid/folder. That reasoning now sits on the loader inGovernedVersionsTest, so the question isn't reopened from scratch next time.How the fixtures are reached
Each test resolves its fixture through the connector by artifact code, the way
SparqlPlaceholderValidationTestalready did — no wrapper of our own in between:A fixture that isn't there fails rather than skips: it would mean the entry was renamed or removed, and the test is no longer testing what it says it is. The connector downloads the suite once per JVM, so several fixtures cost one download.
Second commit: one stale skip-guard from #619
SparqlPlaceholderValidationTest.theRealQueryTemplateHasItsSparqlFieldRecognisedwas written while its suite entry was still a pending pull request, so it skipped when the entry was missing. Nanopublication/nanopub-testsuite#5 merged on 2026-08-20, and the guard has been dead weight since — its own comment claims the test "fails rather than quietly skipping" if a later version of the template moves the SPARQL field, which was not true while an absent entry took it out of the run instead. It now throws, like every other suite fixture here.Checking it
Full run on this branch: 1232 tests, 0 failures, 26 skipped — the pre-change skip count, with nothing skipping on account of the suite any more.
One unrelated flake showed up on an intermediate run and is worth knowing about, but is not from this change:
ApiCachePersistenceTest.entryStoreRoundTripfailed once withTempDirDeletionStrategy$DeletionException— JUnit deleting its@TempDirwhile the persistence thread was still writing into it. Three consecutive reruns of that class pass, and so does the full suite.The retraction was checked before being proposed to the suite:
np checkreports Signed and trusty, and the notes it prints alongside (no creation time, no label, no template) are the ones every existing entry invalid/signed/prints too.🤖 Generated with Claude Code
https://claude.ai/code/session_014dByNErNfuj4au4r5vMsbf