-
Notifications
You must be signed in to change notification settings - Fork 35
test: Add conformance fixtures for two template-parsing divergences [DO NOT MERGE YET] #156
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
Draft
leongdl
wants to merge
1
commit into
OpenJobDescription:mainline
Choose a base branch
from
leongdl:conformance-parsing-divergences
base: mainline
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions
44
conformance-tests/2023-09/EXPR/jobs/7.3--task-file-direct-property-access.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,44 @@ | ||
| # RFC 0005 declares `Task.File.<name>` and `Env.File.<name>` as `path` typed, and | ||
| # shows property access on one directly inside a format string: | ||
| # | ||
| # echo "Script: {{Task.File.Run.name}}" | ||
| # | ||
| # (rfcs/0005-expression-language.md, "Since Session.WorkingDirectory, | ||
| # Task.File.<name>, and Env.File.<name> are path typed ..."). | ||
| # | ||
| # The existing 7.3--task-file-expr-properties fixture only reaches the property | ||
| # through a `let` binding (`cfg = Task.File.config`, then `cfg.parent`), and a | ||
| # property reached inside a function call (`len(Task.File.Run.name)`) parses | ||
| # differently again -- so neither covers the direct member-access form the RFC | ||
| # uses. An implementation whose template validator resolves a `Task.File.*` | ||
| # reference by looking the whole dotted tail up as an embedded-file key rejects | ||
| # this template with "references undefined embedded file 'Run.name'", even though | ||
| # its own runtime resolves the expression correctly and its environment-template | ||
| # validator accepts the equivalent `Env.File.<name>.name`. | ||
| # | ||
| # `filename` is set so the expected value of `.name` is deterministic. | ||
| template: | ||
| specificationVersion: jobtemplate-2023-09 | ||
| extensions: | ||
| - EXPR | ||
| name: TestJob | ||
| steps: | ||
| - name: Step1 | ||
| script: | ||
| embeddedFiles: | ||
| - name: Run | ||
| type: TEXT | ||
| filename: run.txt | ||
| data: "contents\n" | ||
| actions: | ||
| onRun: | ||
| command: python | ||
| args: | ||
| - -c | ||
| - | | ||
| print(r'NAME:{{Task.File.Run.name}}') | ||
| print(r'SUFFIX:{{Task.File.Run.suffix}}') | ||
| expected: | ||
| output: | ||
| - "NAME:run.txt" | ||
| - "SUFFIX:.txt" |
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 (5/5) — spec: §7.3/§7.3.1
Task.File.<name>is path-typed; EL §2.3.1.name/.suffixproperties; direct member access in a format string (RFC 0005 shows this exact form).Explicit
filename: run.txtmakes both expected values deterministic;SUFFIX:.txtcan't be satisfied by a wrongSUFFIX:run.txt. Distinct from the existing let-binding fixture (7.3--task-file-expr-properties): the inline{{Task.File.Run.name}}form exercises the validator path that misparses the dotted tail as an embedded-file key — exactly the divergence this PR documents. Header comment is a model of maintainer-in-a-year readability.