Skip to content

Commit 8785188

Browse files
committed
skip running vap tests for policies with variables when K8s version is 1.27 or 1.26
Signed-off-by: Chandan-DK <[email protected]>
1 parent 29fa54a commit 8785188

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/actions/run-tests/action.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Runs E2E Tests"
22
description: "Runs E2E tests using chainsaw"
33
inputs:
4+
k8s-version:
5+
description: "Kubernetes version"
6+
required: false
47
tests:
58
description: "Test regex"
69
required: true
@@ -16,4 +19,14 @@ runs:
1619
shell: bash
1720
run: |
1821
set -e
19-
chainsaw test --config .chainsaw.yaml --include-test-regex '^chainsaw$/${{ matrix.tests }}' --test-file='${{ inputs.test-file }}' --no-color=false
22+
23+
K8S_VERSION="${{ inputs.k8s-version }}"
24+
TEST_FILE="${{ inputs.test-file }}"
25+
TESTS="${{ inputs.tests }}"
26+
27+
if [[ "$TEST_FILE" == "chainsaw-test-vap" && -n "$K8S_VERSION" ]] &&
28+
[[ "$K8S_VERSION" == "v1.26."* || "$K8S_VERSION" == "v1.27."* ]]; then
29+
chainsaw test --config .chainsaw.yaml --include-test-regex '^chainsaw$/${{ inputs.tests }}' --test-file='${{ inputs.test-file }}' --no-color=false --selector='!skipForVapAlpha'
30+
else
31+
chainsaw test --config .chainsaw.yaml --include-test-regex '^chainsaw$/${{ inputs.tests }}' --test-file='${{ inputs.test-file }}' --no-color=false
32+
fi

.github/workflows/cel-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
with:
9696
tests: ${{ matrix.tests }}
9797
test-file: chainsaw-test-vap
98+
k8s-version: ${{ matrix.k8s-version.version }}
9899

99100
validatingadmissionpolicies-tests-above-1-28:
100101
runs-on: ubuntu-latest
@@ -130,4 +131,5 @@ jobs:
130131
uses: ./.github/actions/run-tests
131132
with:
132133
tests: ${{ matrix.tests }}
133-
test-file: chainsaw-test-vap
134+
test-file: chainsaw-test-vap
135+
k8s-version: ${{ matrix.k8s-version.version }}

pod-security-cel/baseline/disallow-host-process/.chainsaw-test/chainsaw-test-vap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ kind: Test
44
metadata:
55
creationTimestamp: null
66
name: disallow-host-process
7+
labels:
8+
skipForVapAlpha: ""
79
spec:
810
# disable templating because it can cause issues with CEL expressions
911
template: false

0 commit comments

Comments
 (0)