Skip to content

Commit 2c0e3fe

Browse files
fix: tests with validation errors were skipped (#2496)
* fix: tests with validation errors were skipped * fixup * [no ci] fix one test * fix some tests * fix last test --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent f77a443 commit 2c0e3fe

File tree

12 files changed

+14
-16
lines changed

12 files changed

+14
-16
lines changed

pkg/runner/runner_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config
196196
assert.Nil(t, err, j.workflowPath)
197197

198198
planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true)
199-
if err != nil {
199+
if j.errorMessage != "" && err != nil {
200200
assert.Error(t, err, j.errorMessage)
201-
} else {
202-
assert.Nil(t, err, fullWorkflowPath)
203-
201+
} else if assert.Nil(t, err, fullWorkflowPath) {
204202
plan, err := planner.PlanEvent(j.eventName)
205203
assert.True(t, (err == nil) != (plan == nil), "PlanEvent should return either a plan or an error")
206204
if err == nil && plan != nil {

pkg/runner/testdata/actions-environment-and-context-tests/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: actions-with-environment-and-context-tests
2-
description: "Actions with environment (env vars) and context (expression) tests"
2+
run-name: "Actions with environment (env vars) and context (expression) tests"
33
on: push
44

55
jobs:

pkg/runner/testdata/inputs-via-env-context/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
runs-on: self-hosted
55
steps:
66
- uses: actions/checkout@v3
7-
- uses: ./inputs-via-env-context
7+
- uses: ./inputs-via-env-context/action
88
with:
99
test-env-input: ${{ env.test-env-input }}
1010
env:

pkg/runner/testdata/path-handling/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fi
1919
2020
- id: action-with-output
21-
uses: ./path-handling/
21+
uses: ./path-handling/action/
2222

2323
- name: test path (after local action)
2424
run: |

pkg/runner/testdata/shells/bash/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
check:
66
runs-on: ubuntu-latest
77
steps:
8-
- shell: ${{ env.MY_SHELL }}
8+
- shell: bash
99
run: |
1010
if [[ -n "$BASH" ]]; then
1111
echo "I'm $BASH!"
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
container: node:16-buster-slim
1818
steps:
19-
- shell: ${{ env.MY_SHELL }}
19+
- shell: bash
2020
run: |
2121
if [[ -n "$BASH" ]]; then
2222
echo "I'm $BASH!"

pkg/runner/testdata/shells/pwsh/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ jobs:
55
check:
66
runs-on: ubuntu-latest
77
steps:
8-
- shell: ${{ env.MY_SHELL }}
8+
- shell: pwsh
99
run: |
1010
$PSVersionTable
1111
check-container:
1212
runs-on: ubuntu-latest
1313
container: catthehacker/ubuntu:pwsh-latest
1414
steps:
15-
- shell: ${{ env.MY_SHELL }}
15+
- shell: pwsh
1616
run: |
1717
$PSVersionTable
1818
check-job-default:

pkg/runner/testdata/shells/python/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ jobs:
55
check:
66
runs-on: ubuntu-latest
77
steps:
8-
- shell: ${{ env.MY_SHELL }}
8+
- shell: python
99
run: |
1010
import platform
1111
print(platform.python_version())
1212
check-container:
1313
runs-on: ubuntu-latest
1414
container: node:16-buster
1515
steps:
16-
- shell: ${{ env.MY_SHELL }}
16+
- shell: python
1717
run: |
1818
import platform
1919
print(platform.python_version())

pkg/runner/testdata/shells/sh/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
check:
66
runs-on: ubuntu-latest
77
steps:
8-
- shell: ${{ env.MY_SHELL }}
8+
- shell: sh
99
run: |
1010
if [ -z ${BASH+x} ]; then
1111
echo "I'm sh!"
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
container: alpine:latest
1818
steps:
19-
- shell: ${{ env.MY_SHELL }}
19+
- shell: sh
2020
run: |
2121
if [ -z ${BASH+x} ]; then
2222
echo "I'm sh!"

pkg/runner/testdata/windows-add-env/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
env:
3636
KeY: 'n/a'
3737
- uses: actions/checkout@v3
38-
- uses: ./windows-add-env
38+
- uses: ./windows-add-env/action
3939
- name: Assert composite env is merged case insensitive
4040
run: exit 1
4141
if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a'

0 commit comments

Comments
 (0)