From dcdacb618bfa34bc78e037ad302dde6ba181f28d Mon Sep 17 00:00:00 2001 From: unclegedd Date: Wed, 29 May 2024 11:09:04 -0500 Subject: [PATCH 1/2] fix: typo in Zarf pkg name --- src/test/bundles/14-optional-components/uds-bundle.yaml | 2 +- src/test/packages/podinfo-nginx/zarf.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/bundles/14-optional-components/uds-bundle.yaml b/src/test/bundles/14-optional-components/uds-bundle.yaml index d41549af..39073362 100644 --- a/src/test/bundles/14-optional-components/uds-bundle.yaml +++ b/src/test/bundles/14-optional-components/uds-bundle.yaml @@ -18,7 +18,7 @@ packages: - upload-image # deploys podinfo as an optional component and apache as a required component - - name: podinfo-nginx-apache + - name: podinfo-nginx path: ../../packages/podinfo-nginx ref: 0.0.1 optionalComponents: diff --git a/src/test/packages/podinfo-nginx/zarf.yaml b/src/test/packages/podinfo-nginx/zarf.yaml index eb0dd34a..a795bcb7 100644 --- a/src/test/packages/podinfo-nginx/zarf.yaml +++ b/src/test/packages/podinfo-nginx/zarf.yaml @@ -1,6 +1,6 @@ kind: ZarfPackageConfig metadata: - name: podinfo-nginx-apache + name: podinfo-nginx description: used to test bundles with optional components version: 0.0.1 From 81f832c97042e032add582b1ba57742fb0f0b093 Mon Sep 17 00:00:00 2001 From: unclegedd Date: Wed, 29 May 2024 11:25:32 -0500 Subject: [PATCH 2/2] add more zarf init checks --- .github/workflows/release.yaml | 44 ++++++++++++++++++++++++++++++---- src/test/e2e/main_test.go | 9 +++++-- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2cf61a11..3361bdac 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -75,22 +75,58 @@ jobs: - name: Run e2e tests run: | - build/uds run test:e2e + build/uds run test:e2e --no-progress env: GITHUB_TOKEN: secrets.GITHUB_TOKEN + - name: Save logs + if: always() + uses: ./.github/actions/save-logs + + smoke-test: + runs-on: ubuntu-latest + needs: build + steps: + # Checkout the repo and setup the tooling for this job + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + fetch-depth: 0 + + - name: Download build artifacts + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: build-artifacts + path: build/ + + - name: Setup golang + uses: ./.github/actions/golang + + - name: Make UDS-CLI executable + run: | + chmod +x build/uds + + - name: Setup K3d + uses: ./.github/actions/k3d + + - name: Login to GHCR + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run UDS Core smoke test - run: build/uds run test:ci-uds-core-smoke-test + run: build/uds run test:ci-uds-core-smoke-test --no-progress shell: bash - name: Save logs if: always() uses: ./.github/actions/save-logs - push: runs-on: ubuntu-latest environment: release - needs: validate + needs: [validate, smoke-test] permissions: contents: write steps: diff --git a/src/test/e2e/main_test.go b/src/test/e2e/main_test.go index d8d9a685..d4f23f72 100644 --- a/src/test/e2e/main_test.go +++ b/src/test/e2e/main_test.go @@ -123,7 +123,12 @@ func deployZarfInit(t *testing.T) { } func zarfInitDeployed() bool { - cmd := strings.Split("zarf tools kubectl get deployments --namespace zarf", " ") + cmd := strings.Split("zarf tools kubectl get deployments zarf-docker-registry --namespace zarf", " ") _, stderr, _ := e2e.UDS(cmd...) - return !strings.Contains(stderr, "No resources found in zarf namespace") + registryDeployed := !strings.Contains(stderr, "No resources found in zarf namespace") && !strings.Contains(stderr, "not found") + + cmd = strings.Split("zarf tools kubectl get deployments agent-hook --namespace zarf", " ") + _, stderr, _ = e2e.UDS(cmd...) + agentDeployed := !strings.Contains(stderr, "No resources found in zarf namespace") && !strings.Contains(stderr, "not found") + return registryDeployed && agentDeployed }