test: add openshift e2e smoke test #20
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 | |
| # Wait for kube-controller-manager to recover after the libvirt | |
| # snapshot revert by creating a probe Deployment and watching it | |
| # roll out. If kube-controller-manager isn't processing Deployments | |
| # (the typical post-revert symptom), this fails fast with a clear | |
| # signal instead of timing out in the test's CatalogSource wait. | |
| oc create namespace control-plane-probe || true | |
| oc -n control-plane-probe create deploy probe --image=registry.k8s.io/pause:3.10 || true | |
| oc -n control-plane-probe rollout status deploy/probe --timeout=15m | |
| oc delete namespace control-plane-probe --wait=false | |
| - 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 |