Skip to content

Commit 58e9469

Browse files
committed
fix tests broken due to additional check for fromJSON argument
1 parent e831088 commit 58e9469

7 files changed

+24
-24
lines changed

expr_sema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ func TestExprSemanticsCheckOK(t *testing.T) {
638638
{
639639
what: "non-special function",
640640
input: "fromJSON('{}')",
641-
expected: AnyType{},
641+
expected: NewEmptyStrictObjectType(),
642642
availSPFuncs: []string{"always"},
643643
},
644644
{

testdata/err/assign_expression.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ on:
1111
required: 'this is true'
1212

1313
# OK
14-
env: ${{ fromJSON('...') }}
14+
env: ${{ fromJSON('{"FOO":"BAR"}') }}
1515

1616
jobs:
1717
test1:
1818
strategy:
1919
# ERROR
2020
max-parallel: 'max is 3'
2121
# OK
22-
matrix: ${{ fromJSON('...') }}
22+
matrix: ${{ fromJSON('{}') }}
2323
# ERROR
2424
timeout-minutes: '4 minutes'
2525
# OK
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
matrix:
3232
# OK
33-
include: ${{ fromJSON('...') }}
33+
include: ${{ fromJSON('{}') }}
3434
runs-on:
3535
# OK
3636
labels: ${{ 'ubuntu-latest' }}
@@ -41,15 +41,15 @@ jobs:
4141
matrix:
4242
include:
4343
# OK
44-
- ${{ fromJSON('...') }}
44+
- ${{ fromJSON('{}') }}
4545
runs-on: ubuntu-latest
4646
steps:
4747
- run: echo hello
4848
test4:
4949
strategy:
5050
matrix:
5151
# OK
52-
foo: ${{ fromJSON('...') }}
52+
foo: ${{ fromJSON('["x"]') }}
5353
runs-on: ubuntu-latest
5454
steps:
5555
- run: echo hello

testdata/err/expr_check_in_services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on: push
22
jobs:
33
ok1:
4-
services: ${{ fromJSON('...') }}
4+
services: ${{ fromJSON('{}') }}
55
runs-on: ubuntu-latest
66
steps:
77
- run: echo

testdata/ok/issue-285_expr_assign_at_matrix_row.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ jobs:
66
strategy:
77
matrix:
88
test:
9-
- ${{ fromJson('...') }}
9+
- ${{ fromJson('{"foo":{"bar":"test"}}') }}
1010
steps:
1111
- run: echo ${{ matrix.test.foo.bar }}

testdata/ok/issue-402-expression-in-services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ on: push
22
jobs:
33
tests:
44
runs-on: ubuntu-latest
5-
services: ${{ fromJSON('...') }}
5+
services: ${{ fromJSON('{}') }}
66
steps:
77
- run: echo

testdata/ok/matrix_exclude_match_to_expr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ jobs:
66
strategy:
77
matrix:
88
foo:
9-
- ${{ fromJSON('...') }}
9+
- ${{ fromJSON('{"bar":"x"}') }}
1010
exclude:
1111
- foo: bar
1212
steps:
13-
- run: echo ${{ matrix.foo }}
13+
- run: echo ${{ matrix.foo.bar }}
1414
nested-object-1:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
1818
foo:
19-
- bar: ${{ fromJSON('...') }}
19+
- bar: ${{ fromJSON('"x"') }}
2020
exclude:
2121
- foo:
2222
bar: ...
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
foo:
30-
- ["${{ fromJSON('...') }}"]
30+
- ["${{ fromJSON('\"x\"') }}"]
3131
exclude:
3232
- foo: ['...']
3333
steps:

testdata/ok/matrix_expression_in_exclude.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
foo:
99
- aaa
1010
exclude:
11-
- foo: ${{ fromJSON('...') }}
11+
- foo: ${{ fromJSON('"x"') }}
1212
steps:
1313
- run: echo ${{ matrix.foo }}
1414
nested-obj-1:
@@ -18,9 +18,9 @@ jobs:
1818
foo:
1919
- bar: aaa
2020
exclude:
21-
- foo: ${{ fromJSON('...') }}
21+
- foo: ${{ fromJSON('"x"') }}
2222
- foo:
23-
bar: ${{ fromJSON('...') }}
23+
bar: ${{ fromJSON('"x"') }}
2424
steps:
2525
- run: echo ${{ matrix.foo.bar }}
2626
nested-obj-2:
@@ -31,12 +31,12 @@ jobs:
3131
- bar:
3232
piyo: aaa
3333
exclude:
34-
- foo: ${{ fromJSON('...') }}
34+
- foo: ${{ fromJSON('"x"') }}
3535
- foo:
36-
bar: ${{ fromJSON('...') }}
36+
bar: ${{ fromJSON('"x"') }}
3737
- foo:
3838
bar:
39-
piyo: ${{ fromJSON('...') }}
39+
piyo: ${{ fromJSON('"x"') }}
4040
steps:
4141
- run: echo ${{ matrix.foo.bar.piyo }}
4242
nested-array-1:
@@ -46,9 +46,9 @@ jobs:
4646
foo:
4747
- [aaa]
4848
exclude:
49-
- foo: ${{ fromJSON('...') }}
49+
- foo: ${{ fromJSON('"x"') }}
5050
- foo:
51-
- ${{ fromJSON('...') }}
51+
- ${{ fromJSON('"x"') }}
5252
steps:
5353
- run: echo ${{ matrix.foo[0] }}
5454
nested-array-2:
@@ -58,10 +58,10 @@ jobs:
5858
foo:
5959
- [[aaa]]
6060
exclude:
61-
- foo: ${{ fromJSON('...') }}
61+
- foo: ${{ fromJSON('"x"') }}
6262
- foo:
63-
- ${{ fromJSON('...') }}
63+
- ${{ fromJSON('"x"') }}
6464
- foo:
65-
- ["${{ fromJSON('...') }}"]
65+
- ["${{ fromJSON('\"x\"') }}"]
6666
steps:
6767
- run: echo ${{ matrix.foo[0][0] }}

0 commit comments

Comments
 (0)