-
Notifications
You must be signed in to change notification settings - Fork 35
test: repr_py control-character conformance tests #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
leongdl
merged 3 commits into
OpenJobDescription:mainline
from
leongdl:conformance-wrap-actions-expected-failures
Sep 11, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
conformance-tests/2023-09/EXPR/jobs/expr2.2.6--repr-py-newline-roundtrip.test.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Expression Language §2.2.6 defines repr_py as following Python's repr, so a | ||
| # control character in the value must be escaped in the emitted literal. | ||
| # | ||
| # repr_py("a\nb") is handed to ast.literal_eval, CPython's own parser, and the | ||
| # result compared to the input. Paired with | ||
| # WRAP_ACTIONS/jobs/wrap-repr-py-escapes-newline-in-wrapped-args, which pins the | ||
| # same rule through RFC 0008's forwarding pattern. | ||
| # | ||
| # The round-trip must print NEWLINE:PASS. A repr that quotes without escaping | ||
| # emits a raw newline, and CPython raises SyntaxError before the comparison runs. | ||
| # The failure marker is split across two literals because Windows echoes the | ||
| # child command line into the output the harness scans for forbidden strings. | ||
| template: | ||
| specificationVersion: jobtemplate-2023-09 | ||
| extensions: | ||
| - EXPR | ||
| name: TestJob | ||
| steps: | ||
| - name: Step1 | ||
| let: | ||
| - 'q = repr_py("a\nb")' | ||
| script: | ||
| actions: | ||
| onRun: | ||
| command: python | ||
| args: | ||
| - -c | ||
| - | | ||
| import ast | ||
| import sys | ||
| got = ast.literal_eval(sys.argv[1]) | ||
| print("NEWLINE:" + ("PASS" if got == "a\nb" else "FA" "IL got=" + repr(got))) | ||
| - "{{ q }}" | ||
| expected: | ||
| output: | ||
| - NEWLINE:PASS | ||
| forbidden: | ||
| - FAIL |
50 changes: 50 additions & 0 deletions
50
...ce-tests/2023-09/WRAP_ACTIONS/jobs/wrap-repr-py-escapes-newline-in-wrapped-args.test.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Expression Language §2.2.6 defines repr_py as following Python's repr, and RFC | ||
| # 0008's reference forwarding pattern round-trips WrappedAction.Args through it. | ||
| # | ||
| # The wrapped action's arg is a two-line python -c program, the suite's own | ||
| # portable-fixture convention. All three hooks forward it. Paired with | ||
| # EXPR/jobs/expr2.2.6--repr-py-newline-roundtrip, which pins the same rule | ||
| # without the forwarding layer. | ||
| # | ||
| # The grand-child must run and print GRAND_CHILD_RAN. A repr that quotes without | ||
| # escaping embeds the newline raw, and the generated program dies with | ||
| # SyntaxError before reaching subprocess.run. | ||
| template: | ||
| specificationVersion: jobtemplate-2023-09 | ||
| name: WrapReprPyEscapesNewlineInWrappedArgs | ||
| steps: | ||
| - name: Step1 | ||
| script: | ||
| actions: | ||
| onRun: | ||
| command: python | ||
| args: | ||
| - "-c" | ||
| - "import sys\nprint('GRAND_CHILD_RAN')" | ||
| environments: | ||
| - specificationVersion: environment-2023-09 | ||
| extensions: | ||
| - WRAP_ACTIONS | ||
| - EXPR | ||
| environment: | ||
| name: WrapEnv | ||
| script: | ||
| actions: | ||
| onWrapEnvEnter: | ||
| command: python | ||
| args: | ||
| - "-c" | ||
| - "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)" | ||
| onWrapTaskRun: | ||
| command: python | ||
| args: | ||
| - "-c" | ||
| - "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)" | ||
| onWrapEnvExit: | ||
| command: python | ||
| args: | ||
| - "-c" | ||
| - "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)" | ||
| expected: | ||
| output: | ||
| - GRAND_CHILD_RAN |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quorum verdict: GOOD-WITH-NITS (4 reviewers flagged variants of the same two issues) — spec: EL §2.2.6 repr_py (newline must be escaped — spec gives the exact worked example) via RFC 0008 WrappedAction.Args forwarding.
(1) Spec self-tension, correctly disclosed but under-weighted: the fixture's own onRun args contain a literal U+000A, which §5.2's ArgString Cc-exclusion arguably forbids — as written the template may be spec-invalid, so promotion is contingent on resolving §5.2 vs the multi-line
python -cconvention (which the Deadline Docker container env also relies on; if §5.2 is enforced, that breaks service-wide). Resolve the spec question first.(2) Attribution: README says "implementation bug (openjd-rs)" but the 2026-08-12 sweep shows it fails BOTH implementations — state Python's status.
(3) Partial overlap with PR #165's expr2.2.6--repr-py-newline-roundtrip (same root defect); the end-to-end wrap path justifies keeping both, but cross-reference them.