Skip to content

Commit

Permalink
Listing variable expansion patterns in the Include runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 28, 2023
1 parent 2e69348 commit 0f155d0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ func TestRunUsingLoop(t *testing.T) {
book string
}{
{"testdata/book/loop.yml"},
{"testdata/book/include_loop.yml"},
}
ctx := context.Background()
for _, tt := range tests {
Expand Down Expand Up @@ -502,6 +501,7 @@ func TestInclude(t *testing.T) {
book string
}{
{"testdata/book/include_main.yml"},
{"testdata/book/include_vars.yml"},
}
ctx := context.Background()
for _, tt := range tests {
Expand Down
14 changes: 0 additions & 14 deletions testdata/book/include_loop.yml

This file was deleted.

9 changes: 0 additions & 9 deletions testdata/book/include_str_int.yml

This file was deleted.

17 changes: 17 additions & 0 deletions testdata/book/include_vars_included.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
desc: Include vars (included)
if: included
steps:
-
test: |
vars.a == 12345
&& vars.b == "54321"
&& vars.c == 12345
&& vars.d == 54321
&& vars.e == 123459
&& vars.f == 543219
&& vars.g == 912345
&& vars.h == 954321
&& vars.i == "12345"
&& vars.j == "54321"
&& vars.k == "123459"
&& vars.l == "543219"
21 changes: 21 additions & 0 deletions testdata/book/include_vars_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
desc: Include vars
vars:
intNumber: 12345
strNumber: "54321"
steps:
-
include:
path: include_vars_included.yml
vars:
a: 12345
b: "54321"
c: '{{ vars.intNumber }}'
d: '{{ vars.strNumber }}'
e: '{{ vars.intNumber }}9'
f: '{{ vars.strNumber }}9'
g: '9{{ vars.intNumber }}'
h: '9{{ vars.strNumber }}'
i: '{{ string(vars.intNumber) }}'
j: '{{ string(vars.strNumber) }}'
k: '"{{ vars.intNumber }}9"'
l: '"{{ vars.strNumber }}9"'

0 comments on commit 0f155d0

Please sign in to comment.