Skip to content

Commit

Permalink
Add OCP QE Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Oct 25, 2023
1 parent b6ef470 commit 4f3ed1f
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/qe-ocp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: QE OCP Testing

on:
pull_request:
branches: [ main ]
workflow_dispatch:
# Schedule a daily cron at midnight UTC
schedule:
- cron: '0 0 * * *'
env:
QE_REPO: test-network-function/cnfcert-tests-verification

jobs:
qe-ocp-testing:
runs-on: qe-ocp
strategy:
fail-fast: false
matrix:
suite: [accesscontrol, affiliatedcertification, manageability, networking, lifecycle, performance, platformalteration, observability, operator]
env:
SHELL: /bin/bash
KUBECONFIG: '/home/labuser/.kube/config'
PFLT_DOCKERCONFIG: '/home/labuser/.docker/config'
TEST_TNF_IMAGE_NAME: quay.io/testnetworkfunction/cnf-certification-test
TEST_TNF_IMAGE_TAG: localtest
DOCKER_CONFIG_DIR: '/home/labuser/.docker'

steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Run initial setup
uses: ./.github/actions/setup

- name: Check if 'localtest' image already exists
shell: bash
run: |
if [[ $(docker images -q quay.io/testnetworkfunction/cnf-certification-test:localtest) ]]; then
echo "Image already exists"
echo "IMAGE_EXISTS=true" >> $GITHUB_ENV
else
echo "Image does not exist and needs to be built"
fi
- name: Build the test image
run: make build-image-local # quay.io/testnetworkfunction/cnf-certification-test:localtest
if: ${{ env.IMAGE_EXISTS != 'true' }}

- name: Show pods
run: oc get pods -A

- name: Clone the QE repository
uses: actions/checkout@v4
with:
repository: ${{ env.QE_REPO }}
path: cnfcert-tests-verification

- name: Preemptively potential QE namespaces
run: ./scripts/delete-namespaces.sh
working-directory: cnfcert-tests-verification

# Setup is complete. Time to run the QE tests.
- name: Run the tests
run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features
working-directory: cnfcert-tests-verification

- name: Delete test image
shell: bash
run: |
if [[ $(docker images -q quay.io/testnetworkfunction/cnf-certification-test:localtest) ]]; then
docker rmi quay.io/testnetworkfunction/cnf-certification-test:localtest
fi
if: always()

0 comments on commit 4f3ed1f

Please sign in to comment.