From 0e4907c0d56ad231e49a1cf2c8877ea91036c381 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Wed, 18 Sep 2024 22:49:49 -0400 Subject: [PATCH] Add GHA to run MCS conformance tests The GHA clones the "sigs.k8s.io/mcs-api" repo with the desired commit and runs `go test` directly in the directory. "v0.1.0" doesn't have the conformance tests so we can't run them via Go import and trying to import a later commit is problematic due incompatible changes to the MCS APIs. Also the conformance tests are really tied to the MCS spec and not specifically to the API version so they'll likely evolve separately anyway. The clusterset IP field in the ServiceImport is required by the spec for ClusterIP services so that conformance test will fail unless the clusterset IP feature is enabled in Lighthouse. However, with that enabled, the connectivity conformance tests will fail b/c Submariner doesn't perform routing in that case. Thus, two separate GHA jobs are configured, one with clusterset IP enabled and one without, and the appropriate conformance tests are run/skipped by specifying the appropriate Ginkgo label filter. Signed-off-by: Tom Pantelis --- .github/workflows/e2e.yml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e0373fdc..ed87f7fa 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -68,3 +68,49 @@ jobs: - name: Post mortem if: failure() uses: submariner-io/shipyard/gh-actions/post-mortem@devel + conformance-test: + name: MCS Conformance + needs: images + timeout-minutes: 60 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + using: ['clusterset-ip', ''] + steps: + - name: Check out the repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Check out the mcs-api repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + with: + ref: 11bd71901bbe5b1630ceea73d27597364c9af683 + repository: kubernetes-sigs/mcs-api + path: mcs-api + + - name: Deploy Submariner + shell: bash + run: | + make deploy using="${{ matrix.using }}" + + - name: Run conformance tests + shell: bash + run: | + export KUBECONFIG=$(find $(git rev-parse --show-toplevel)/output/kubeconfigs/ -type f -printf %p:) + label_filter="!ClusterIP || Connectivity" + if [[ "${{ matrix.using }}" =~ "clusterset-ip" ]]; then + label_filter="ClusterIP && !Connectivity" + fi + cd mcs-api/conformance + go test -v -timeout 30m -contexts cluster1,cluster2 -args -test.timeout 15m \ + --ginkgo.v --ginkgo.trace --ginkgo.label-filter "${label_filter}" + + - name: Print report.html + if: always() + shell: bash + run: | + cat mcs-api/conformance/report.html + + - name: Post mortem + if: failure() + uses: submariner-io/shipyard/gh-actions/post-mortem@devel