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>
This commit is contained in:
ChristopherHX
2024-10-28 05:03:42 +01:00
committed by GitHub
parent f77a443edf
commit 2c0e3fea00
12 changed files with 14 additions and 16 deletions

View File

@@ -196,11 +196,9 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config
assert.Nil(t, err, j.workflowPath) assert.Nil(t, err, j.workflowPath)
planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true) planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true)
if err != nil { if j.errorMessage != "" && err != nil {
assert.Error(t, err, j.errorMessage) assert.Error(t, err, j.errorMessage)
} else { } else if assert.Nil(t, err, fullWorkflowPath) {
assert.Nil(t, err, fullWorkflowPath)
plan, err := planner.PlanEvent(j.eventName) plan, err := planner.PlanEvent(j.eventName)
assert.True(t, (err == nil) != (plan == nil), "PlanEvent should return either a plan or an error") assert.True(t, (err == nil) != (plan == nil), "PlanEvent should return either a plan or an error")
if err == nil && plan != nil { if err == nil && plan != nil {

View File

@@ -1,5 +1,5 @@
name: actions-with-environment-and-context-tests 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 on: push
jobs: jobs:

View File

@@ -4,7 +4,7 @@ jobs:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./inputs-via-env-context - uses: ./inputs-via-env-context/action
with: with:
test-env-input: ${{ env.test-env-input }} test-env-input: ${{ env.test-env-input }}
env: env:

View File

@@ -18,7 +18,7 @@ jobs:
fi fi
- id: action-with-output - id: action-with-output
uses: ./path-handling/ uses: ./path-handling/action/
- name: test path (after local action) - name: test path (after local action)
run: | run: |

View File

@@ -5,7 +5,7 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: bash
run: | run: |
if [[ -n "$BASH" ]]; then if [[ -n "$BASH" ]]; then
echo "I'm $BASH!" echo "I'm $BASH!"
@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:16-buster-slim container: node:16-buster-slim
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: bash
run: | run: |
if [[ -n "$BASH" ]]; then if [[ -n "$BASH" ]]; then
echo "I'm $BASH!" echo "I'm $BASH!"

View File

@@ -5,14 +5,14 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: pwsh
run: | run: |
$PSVersionTable $PSVersionTable
check-container: check-container:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: catthehacker/ubuntu:pwsh-latest container: catthehacker/ubuntu:pwsh-latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: pwsh
run: | run: |
$PSVersionTable $PSVersionTable
check-job-default: check-job-default:

View File

@@ -5,7 +5,7 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: python
run: | run: |
import platform import platform
print(platform.python_version()) print(platform.python_version())
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:16-buster container: node:16-buster
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: python
run: | run: |
import platform import platform
print(platform.python_version()) print(platform.python_version())

View File

@@ -5,7 +5,7 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: sh
run: | run: |
if [ -z ${BASH+x} ]; then if [ -z ${BASH+x} ]; then
echo "I'm sh!" echo "I'm sh!"
@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: alpine:latest container: alpine:latest
steps: steps:
- shell: ${{ env.MY_SHELL }} - shell: sh
run: | run: |
if [ -z ${BASH+x} ]; then if [ -z ${BASH+x} ]; then
echo "I'm sh!" echo "I'm sh!"

View File

@@ -35,7 +35,7 @@ jobs:
env: env:
KeY: 'n/a' KeY: 'n/a'
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./windows-add-env - uses: ./windows-add-env/action
- name: Assert composite env is merged case insensitive - name: Assert composite env is merged case insensitive
run: exit 1 run: exit 1
if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a' if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a'