test: add openshift e2e smoke test #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenShift compatibility — PR verification | |
| # Temporary: verifies the harness on the runner before merging okd-test. | |
| # Delete once main has run `OpenShift compatibility` green at least once. | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/openshift-compatibility.yaml' | |
| - '.github/workflows/openshift-compatibility-pr.yaml' | |
| - 'test/deploy/openshift_test.go' | |
| - 'test/deploy/deploy_test.go' | |
| - 'test/deploy/olm_manifests.yaml.tmpl' | |
| - 'Makefile' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: openshift-compatibility | |
| cancel-in-progress: false | |
| env: | |
| KUBECONFIG: /home/runner/okd-install/auth/kubeconfig | |
| jobs: | |
| compat: | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: [self-hosted, openshift, operator] | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Reset cluster to baseline snapshot | |
| run: /usr/local/bin/okd-revert.sh | |
| - name: Verify cluster health | |
| run: | | |
| oc get nodes | |
| bad=$(oc get co --no-headers \ | |
| | awk '$1 != "authentication" && $1 != "monitoring" && $1 != "image-registry" \ | |
| && ($3 != "True" || $4 != "False" || $5 != "False") { print $1 }') | |
| if [ -n "$bad" ]; then | |
| echo "Unhealthy ClusterOperators: $bad" | |
| oc get co | |
| exit 1 | |
| fi | |
| oc wait --for=jsonpath='{.status.conditions[?(@.type=="Available")].status}=True' \ | |
| apiservice v1.project.openshift.io --timeout=5m | |
| # OLM informer caches do not re-sync cleanly after the libvirt | |
| # snapshot revert. Force clean OLM startup before the test runs. | |
| # `kubectl rollout restart` requires kube-controller-manager to | |
| # create a new ReplicaSet (also unreliable post-revert); deleting | |
| # the pod only requires the ReplicaSet controller to recreate it. | |
| for app in catalog-operator olm-operator; do | |
| oc delete pod -n openshift-operator-lifecycle-manager -l app=$app | |
| done | |
| for app in catalog-operator olm-operator; do | |
| oc wait --for=condition=Ready pod -n openshift-operator-lifecycle-manager -l app=$app --timeout=5m | |
| done | |
| - name: Install OLM tooling | |
| run: make operator-sdk opm | |
| - name: Run OLM compatibility e2e | |
| env: | |
| CLICKHOUSE_VERSION: "26.3" | |
| run: make test-compat-e2e-olm-openshift | |
| - name: Upload test report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: openshift-compatibility-pr-report | |
| path: "**/report/*" | |
| if-no-files-found: warn | |
| overwrite: true | |
| - name: Wipe workspace | |
| if: always() | |
| run: rm -rf "$GITHUB_WORKSPACE/.git" "$GITHUB_WORKSPACE/_work" || true |