Skip to content

Commit 110018a

Browse files
committed
test: Wrap a RANGE_EXPR parameter in string() before repr_sh
The `parameter_types::all_types_scenario.yaml` scenario has been failing CI with: Failed to parse interpolation expression at [378, 411]. No matching signature for repr_sh(range_expr) repr_sh(Param.RangeExprParam) `repr_sh` is registered for `(string)`, `(path)`, `(list[string])`, `(list[path])` and `(list[nulltype])`. It has no `range_expr` overload, so openjd-model 0.11.3 is right to reject this and the template was wrong. `string` does declare `(range_expr) -> string`, so wrapping resolves it, and every other non-string parameter on the surrounding lines already does exactly that: echo IntParam={{repr_sh(string(Param.IntParam))}} echo BoolParam={{repr_sh(string(Param.BoolParam))}} echo len-RangeExprParam={{repr_sh(string(len(Param.RangeExprParam)))}} The rendered output is unchanged, so the scenario's expected `RangeExprParam=10-15` still matches. Confirmed by running the scenario against a build that accepts both forms: it passes before and after, which is what makes this a signature fix rather than a behaviour change. This is the only affected call. The other bare `repr_sh(Param.*)` uses in the test scenarios are all `string` or `path` typed, which it accepts. Unrelated to the rest of this branch. It surfaces here only because CI resolves released openjd-model while a local editable checkout can be on an older build that still accepted the bare form. Separated into its own commit so it can be dropped or landed independently. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
1 parent 3574ced commit 110018a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/openjd/sessions_v1/scenarios/parameter_types/all_types_template.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ steps:
5656
echo PathParam={{repr_sh(Param.PathParam)}}
5757
echo PathParam.name={{repr_sh(Param.PathParam.name)}}
5858
echo BoolParam={{repr_sh(string(Param.BoolParam))}}
59-
echo RangeExprParam={{repr_sh(Param.RangeExprParam)}}
59+
echo RangeExprParam={{repr_sh(string(Param.RangeExprParam))}}
6060
echo len-RangeExprParam={{repr_sh(string(len(Param.RangeExprParam)))}}
6161
echo ListStringParam={{repr_sh(string(Param.ListStringParam))}}
6262
echo ListStringParam-0={{repr_sh(Param.ListStringParam[0])}}

0 commit comments

Comments
 (0)