test: Add conformance fixtures for two template-parsing divergences [DO NOT MERGE] - #156
Draft
leongdl wants to merge 1 commit into
Draft
Conversation
Both were found while reviewing RFC 0008 wrap-action support across the two
implementations, and each is currently red on exactly one of them.
EXPR/jobs/7.3--task-file-direct-property-access:
RFC 0005 declares Task.File.<name> as path-typed and shows property access
directly in a format string ({{Task.File.Run.name}}). The existing
7.3--task-file-expr-properties fixture only reaches the property through a
let binding, and a property inside a function call parses differently again,
so the direct member-access form the RFC uses was uncovered. openjd-rs
rejects it at validation ('references undefined embedded file Run.name')
while its own runtime resolves it and its environment-template validator
accepts the Env.File equivalent.
EXPR/job_templates/3--int-literal-above-int64-max.invalid:
RFC 0005 section 3 bounds integers to -2^63..2^63-1. A literal timeout of
2^63 must be rejected at validation. openjd-model accepts it, so the problem
is only discovered at run time -- and before it was bounded there, it
overflowed the runtime's duration type.
Verified against both CLIs: fixture 1 passes on the Python stack and fails on
openjd-rs; fixture 2 passes on openjd-rs and fails on the Python stack.
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
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.
Important
DO NOT MERGE YET. Opened as a draft on purpose. Each fixture here is
currently red on exactly one implementation, so merging before the two owning
bugs are fixed puts a permanent failure in both conformance suites. See
Merge sequencing below.
Adds two conformance fixtures for template-parsing (validation-time)
divergences found while reviewing RFC 0008 wrap-action support across the two
implementations. Neither was covered by the existing suite, which is why both
survived.
1.
EXPR/jobs/7.3--task-file-direct-property-access.test.yamlRFC 0005 declares
Task.File.<name>andEnv.File.<name>aspathtyped, andshows property access on one directly inside a format string:
An implementation whose template validator resolves a
Task.File.*reference bylooking the whole dotted tail up as an embedded-file key rejects that form:
…even though its own runtime resolves the expression correctly, and its
environment-template validator accepts the equivalent
Env.File.<name>.name.Why it was uncovered. The existing
7.3--task-file-expr-propertiesfixturereaches the property through a
letbinding (cfg = Task.File.config, thencfg.parent), and a property reached inside a function call(
len(Task.File.Run.name)) parses differently again. I verified all three forms:only the direct member-access form the RFC itself uses triggers the rejection,
and nothing exercised it.
filenameis set in the fixture so the expected value of.nameisdeterministic.
2.
EXPR/job_templates/3--int-literal-above-int64-max.invalid.yamlRFC 0005 §3 ("64-bit Signed Integer Type") bounds integers to −2⁶³ … 2⁶³−1 and
says any value outside that range is an error. This template's
timeoutis 2⁶³(
9223372036854775808), one past the maximum, so validation must reject it.An implementation whose model has no upper bound accepts the template and only
discovers the problem at run time — or converts it into a native duration type
and overflows. Rejecting it at validation is what lets a submitter see the error
before the job is ever scheduled.
Verified against both reference CLIs
Task.File.*property accessEach red is a tracked defect in a different implementation, and each fixture is
green on the other — which is the intended shape of a conformance test.
Merge sequencing
Merging this PR makes one suite red on each implementation until the owning bugs
land. Suggested order:
Task.File.<name>property-access validator in openjd-rs.Alternatively merge it first, deliberately, as the failing test that drives both
fixes — happy either way, but it should be a conscious choice rather than a
surprise.
Related, not included
An INT parameter default above 2⁶³−1 (
type: INT, default: 9223372036854775808)is accepted by both implementations today, verified with
openjd checkonboth CLIs. RFC 0005 §3 says it should not be. I deliberately did not add a
fixture for it, because it would sit permanently red on both suites and needs a
decision first: either fix both models, or clarify that the integer domain
constrains expression evaluation rather than literal parameter defaults.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.