Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tests with validation errors were skipped #2496

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pkg/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,9 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config
assert.Nil(t, err, j.workflowPath)

planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true)
if err != nil {
if j.errorMessage != "" && err != nil {
assert.Error(t, err, j.errorMessage)
} else {
assert.Nil(t, err, fullWorkflowPath)

} else if assert.Nil(t, err, fullWorkflowPath) {
plan, err := planner.PlanEvent(j.eventName)
assert.True(t, (err == nil) != (plan == nil), "PlanEvent should return either a plan or an error")
if err == nil && plan != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: actions-with-environment-and-context-tests
description: "Actions with environment (env vars) and context (expression) tests"
run-name: "Actions with environment (env vars) and context (expression) tests"
on: push

jobs:
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/testdata/inputs-via-env-context/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: ./inputs-via-env-context
- uses: ./inputs-via-env-context/action
with:
test-env-input: ${{ env.test-env-input }}
env:
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/testdata/path-handling/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fi

- id: action-with-output
uses: ./path-handling/
uses: ./path-handling/action/

- name: test path (after local action)
run: |
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/testdata/shells/bash/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: bash
run: |
if [[ -n "$BASH" ]]; then
echo "I'm $BASH!"
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
container: node:16-buster-slim
steps:
- shell: ${{ env.MY_SHELL }}
- shell: bash
run: |
if [[ -n "$BASH" ]]; then
echo "I'm $BASH!"
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/testdata/shells/pwsh/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: pwsh
run: |
$PSVersionTable
check-container:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:pwsh-latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: pwsh
run: |
$PSVersionTable
check-job-default:
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/testdata/shells/python/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: python
run: |
import platform
print(platform.python_version())
check-container:
runs-on: ubuntu-latest
container: node:16-buster
steps:
- shell: ${{ env.MY_SHELL }}
- shell: python
run: |
import platform
print(platform.python_version())
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/testdata/shells/sh/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: sh
run: |
if [ -z ${BASH+x} ]; then
echo "I'm sh!"
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- shell: ${{ env.MY_SHELL }}
- shell: sh
run: |
if [ -z ${BASH+x} ]; then
echo "I'm sh!"
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/testdata/windows-add-env/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
env:
KeY: 'n/a'
- uses: actions/checkout@v3
- uses: ./windows-add-env
- uses: ./windows-add-env/action
- name: Assert composite env is merged case insensitive
run: exit 1
if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a'
Loading