Skip to content

Commit

Permalink
ci: skip non-required integration tests
Browse files Browse the repository at this point in the history
load often fails. complexity and upgrade are not indicators of a direct issue and might be failing. such non-required tests can/must be skipped in certain situations.
  • Loading branch information
xoph authored and xopham committed Oct 10, 2023
1 parent fbf70af commit ea5091b
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
72 changes: 69 additions & 3 deletions .github/workflows/.reusable-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ env:

jobs:
integration-test:
name: integration test
name: functional
runs-on: ubuntu-latest
if: inputs.skip_integration_tests != 'all'
permissions:
packages: read
env:
Expand All @@ -42,8 +43,6 @@ jobs:
matrix:
integration-test-arg:
[
"complexity",
"load",
"regular",
"cosign",
"multi-cosigned",
Expand All @@ -53,6 +52,71 @@ jobs:
"pre-config",
"other-ns",
"configured-cert",
]
services:
alerting-endpoint:
image: securesystemsengineering/alerting-endpoint
ports:
- 56243:56243
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Login with registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ inputs.build_registry }}
username: ${{ inputs.repo_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
run: |
sudo snap install yq
- uses: ./.github/actions/k8s-version-config
name: Setup k8s cluster
with:
k8s-version: v1.25
- name: Get alerting endpoint IP
id: get_ip
uses: ./.github/actions/alerting-endpoint
- name: Run test
run: |
bash tests/integration/integration-test.sh "${{ matrix.integration-test-arg }}"
env:
ALERTING_ENDPOINT_IP: ${{ steps.get_ip.outputs.ip }}
- name: Display Connaisseur configuration
if: always()
run: |
echo "::group::values.yaml"
yq e '... comments=""' helm/values.yaml
echo "::endgroup::"
- name: Display k8s state if integration test failed
if: failure()
run: |
kubectl describe deployments.apps -n connaisseur -lapp.kubernetes.io/name=connaisseur
kubectl describe pods -n connaisseur -lapp.kubernetes.io/name=connaisseur
- name: Display logs if integration test failed
if: failure()
run: |
kubectl logs -n connaisseur -lapp.kubernetes.io/name=connaisseur --prefix=true
optional-integration-test:
name: optional
runs-on: ubuntu-latest
if: |
inputs.skip_integration_tests != 'non-required' &&
inputs.skip_integration_tests != 'all'
permissions:
packages: read
env:
IMAGE: ${{ inputs.build_image_repository }}
TAG: ${{ inputs.build_tag }}
COSIGN_PUBLIC_KEY: ${{ inputs.cosign_public_key }}
strategy:
fail-fast: false
matrix:
integration-test-arg:
[
"complexity",
"load",
"upgrade",
]
services:
Expand Down Expand Up @@ -101,7 +165,9 @@ jobs:
kubectl logs -n connaisseur -lapp.kubernetes.io/name=connaisseur --prefix=true
k8s-versions:
name: k8s versions
runs-on: ubuntu-latest
if: inputs.skip_integration_tests != 'all'
permissions:
packages: read
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
integration-test:
uses: ./.github/workflows/.reusable-integration-test.yml
needs: [conditionals, build]
if: needs.conditionals.outputs.skip_integration_tests != 'all'
permissions:
packages: read
secrets: inherit
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
integration-test:
uses: ./.github/workflows/.reusable-integration-test.yml
needs: [conditionals, build]
if: needs.conditionals.outputs.skip_integration_tests != 'all'
permissions:
packages: read
secrets: inherit
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
integration-test:
uses: ./.github/workflows/.reusable-integration-test.yml
needs: [conditionals, build, version-match]
if: needs.conditionals.outputs.skip_integration_tests != 'all'
permissions:
packages: read
secrets: inherit
Expand Down

0 comments on commit ea5091b

Please sign in to comment.