test(workflow_ops): unit tests for module helpers#147
Merged
Conversation
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.
Summary
Adds 8 inline unit tests to
crates/taskito-python/src/py_queue/workflow_ops/mod.rscovering the three pure helpers and thecascade_skip_pending_nodesorchestrator that the rest of the workflow_ops submodules build on:build_metadata_json— JSON output is correctly escaped for special characters and Unicode (regression coverage for the bug whose fix is documented inline).parse_step_metadata— happy-path round-trip + invalid-JSON error path.status_to_py— canonical state string mapping.cascade_skip_pending_nodes— pending/ready nodes get skipped, terminal/running nodes left alone, attached jobs get cancelled, and an empty node slice is a no-op.The PyO3 entry-point methods (
mark_workflow_node_result,check_fan_out_completion,expand_fan_out, gate ops, etc.) are not covered here. They takePython<'_>and callpy.allow_threadsandself.storage— testing them as Rust unit tests would require constructing a fullPyQueueplus a Python interpreter. The underlying state transitions they wrap (finalize_fan_out_parent,update_workflow_run_state,update_workflow_node_status) are already tested in thetaskito-workflowscrate's contract suite. The remaining gap is the PyO3 glue, which is exercised by the Python workflow test suite end-to-end.Addresses recommendation 7 from the 2026-05-08 audit (
.claude/reports/audit-2026-05-08.md).Test plan
cargo test --workspace --features workflows— 8 new tests pass alongside the existing suite.cargo clippy --workspace --features workflows— clean.cargo fmt --all --check— clean.