diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-14 16:01:55 +0000 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-14 16:01:55 +0000 |
| commit | 05907254d44ccde0aa0c1f536d2ba838d0645402 (patch) | |
| tree | a2abf7978944730426a4452e654425a8f6e02b34 /test/python | |
| parent | 0d016ee2211fe08722377c4089ce24fa4c98ccdf (diff) | |
| download | genenetwork4-05907254d44ccde0aa0c1f536d2ba838d0645402.tar.gz | |
gemma: read ccwl's YAML when checking the workflow's inputs, and fix two stale tests
`ccwl compile` emits CWL as YAML (its only other target is dot), so the
new input check must read that shape -- it was parsing JSON and would
have turned a working request into a 502. A hand-written scan of the
`inputs:` block, deliberately not a YAML dependency: ccwl's output is
machine-generated and unvaried, and adding serde_yaml would mean
regenerating the crate list in guix.scm for one small check.
Two tests were stale in ways only the package's own check phase shows:
- tests/auth.rs built AuthToken literals without the new `scheme`/`id`
fields, so the crate's integration tests did not compile;
- test/python/test_envelope.py asserted that /version carries no `next`
links, which stopped being true when every read endpoint gained them
("always offer the next step"). The deployed build fails that test
too, so it is not a regression from this work -- but it did block
`guix build -f guix.scm` at the python-rest-test phase.
Verified with the packaged binary (guix build -f guix.scm, all phases
including both test suites): POST /compute/gemma/ravanan through ravanan
and the Slurm container returned 200 with 636 rows in 13.6 s, on a
request authenticated with a gn4ai_ short token -- the log line naming
user zachs, scheme opaque and token smoke-2.
Diffstat (limited to 'test/python')
| -rw-r--r-- | test/python/test_envelope.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/python/test_envelope.py b/test/python/test_envelope.py index aa9ced3..c81e0a8 100644 --- a/test/python/test_envelope.py +++ b/test/python/test_envelope.py @@ -65,7 +65,20 @@ class EnvelopeTest(ServerTestCase): envelope["meta"]["request_id"], response.getheader("x-request-id") ) self.assertEqual(envelope["notes"], []) - self.assertEqual(envelope["next"], []) + # /version used to carry no `next` links; the "always offer the next + # step" design gave every read endpoint some, so assert the shape -- + # a list of {href, description} -- rather than emptiness. (This was + # stale in the repo and failed the package's own check phase, against + # a deployed build that had the links too.) + self.assertIsInstance(envelope["next"], list) + self.assertTrue(envelope["next"], "a read endpoint offers next steps") + for step in envelope["next"]: + self.assertIsInstance(step["href"], str) + self.assertIsInstance(step["description"], str) + self.assertTrue( + any(step["href"] == "/groups" for step in envelope["next"]), + envelope["next"], + ) def test_errors_carry_the_request_id_and_took_ms(self): # The token extractor's 401: needs no database or gn-auth. |
