Update example project tests for Tenzir v6 - #61
Merged
Conversation
The reference project's tests had drifted away from the TQL the current
binary accepts, so a newcomer pointing tenzir-test at example-project saw
failures that had nothing to do with the harness. CI never runs these
tests, which is why the rot went unnoticed.
- 'from_file' on an .ndjson file needs an explicit '{ read_ndjson }'
parser subpipeline.
- The 'http' operator is gone; sending each event as a request body is now
'each { from_http url, body=$this }'.
- Module-style names for built-in operators are deprecated because modules
are reserved for packages: 'pipeline::detach', 'context::create_lookup_table',
'context::update' and 'context::inspect' lose their namespaces.
Baselines are unchanged, so the repaired pipelines produce the same output.
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.
🔍 Problem
example-projectis our reference for how atenzir-testproject looks, butits tests had drifted away from the TQL that Tenzir v6 accepts. Ten of them
failed on a current binary, so anyone following the README saw a broken
project and could not tell harness bugs from example rot.
CI never runs these tests —
ci.ymlonly checks thattenzir-test --helpworks on the built wheel — which is why this went unnoticed.
🛠️ Solution
from_fileon an.ndjsonfile needs an explicit{ read_ndjson }parsersubpipeline.
httpoperator is gone. Sending each event as a request body is noweach { from_http url, body=$this }, which also applies to theExecutorexample in
request.py.reserved for packages:
pipeline::detach,context::create_lookup_table,context::update, andcontext::inspectlose their namespaces.Baselines are unchanged, so the repaired pipelines produce the same output as
the ones they replace.
💬 Review
Before: 10 failures. After:
uvx tenzir-test --root example-project -j 4leaves only tests that are designed to fail, and they should stay that way:
tests/fail.tqlandtests/shell/exit-code-test.shdemonstrate failurerendering, with hand-doctored baselines and
exit 42.tests/python/pure-python/flaky_coin.pyis a coin flip withretry: 5, soit fails roughly 1 run in 32 by construction.
That mix is the real usability problem here: a green run is impossible, so
drift like this hides in plain sight. Two follow-ups worth discussing, both
out of scope for this PR:
- Isolate the intentional failures (own directory, or an
- Add a CI job that runs
📎 Related: #60expect-failuremarker) so the rest of the project can run green.
example-projectagainst a releasedtenzir, whichwould have caught every change here.