From bae07c44425440586852de38d3e22f990bff12ea Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Wed, 25 Sep 2024 13:28:28 -0700 Subject: [PATCH 1/4] Move multi-app-backup-and-restore test to Playwright --- .github/workflows/build-test.yaml | 6 +-- e2e/inventory/inventory.go | 5 ++- .../app1-license.yaml | 24 +++++++++++ .../app2-license.yaml | 24 +++++++++++ .../multi-app-backup-and-restore/test.spec.ts | 40 +++++++++++++++++++ 5 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml create mode 100644 e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml create mode 100644 e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 14b4605984..ee7ad4d325 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -2857,12 +2857,10 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'multi-app-backup-and-restore' + test-focus: 'Multi App Backup and Restore' kots-namespace: 'multi-app-backup-and-restore' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} - testim-access-token: '${{ secrets.TESTIM_ACCESS_TOKEN }}' - testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -4337,7 +4335,6 @@ jobs: - validate-min-kots-version - validate-target-kots-version - validate-range-kots-version - - validate-multi-app-backup-and-restore - validate-airgap-smoke-test - validate-support-bundle - validate-gitops @@ -4347,6 +4344,7 @@ jobs: - validate-no-required-config - validate-config - validate-change-channel + - validate-multi-app-backup-and-restore - validate-multi-app-install # non-testim tests - validate-minimal-rbac diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index edec8db198..0180f067b9 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -104,9 +104,10 @@ func NewChangeLicense() Test { func NewMultiAppBackupAndRestoreTest() Test { return Test{ - Name: "multi-app-backup-and-restore", - TestimSuite: "multi-app-backup-and-restore", + ID: "multi-app-backup-and-restore", + Name: "Multi App Backup and Restore", Namespace: "multi-app-backup-and-restore", + AppSlug: "multi-app-backup-and-restore", UpstreamURI: "multi-app-backup-and-restore/automated", NeedsSnapshots: true, } diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml b/e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml new file mode 100644 index 0000000000..b4c8fc2b2f --- /dev/null +++ b/e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml @@ -0,0 +1,24 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: multi-app-backup-and-restore-1 +spec: + appSlug: multi-app-backup-and-restore-1 + channelID: 2P3qPsmKpdq9P9a5Nze5EPttBXa + channelName: Automated + customerName: multi-app-backup-and-restore-1 + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + signature: {} + title: Expiration + value: "" + valueType: String + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 2P3rVESF5woQVawjvHWaPSpfU4t + licenseSequence: 1 + licenseType: dev + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pYlhWc2RHa3RZWEJ3TFdKaFkydDFjQzFoYm1RdGNtVnpkRzl5WlMweEluMHNJbk53WldNaU9uc2liR2xqWlc1elpVbEVJam9pTWxBemNsWkZVMFkxZDI5UlZtRjNhblpJVjJGUVUzQm1WVFIwSWl3aWJHbGpaVzV6WlZSNWNHV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0psVlU1UFlrWkdRMVZZWXpsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml b/e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml new file mode 100644 index 0000000000..15ae777c3c --- /dev/null +++ b/e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml @@ -0,0 +1,24 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: multi-app-backup-and-restore-2 +spec: + appSlug: multi-app-backup-and-restore-2 + channelID: 2P3rblvZxINhbckyp67PHj3MlbP + channelName: Automated + customerName: multi-app-backup-and-restore-2 + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + signature: {} + title: Expiration + value: "" + valueType: String + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 2P3ru6kPlP6fcWbajAe9RVlvhHL + licenseSequence: 1 + licenseType: dev + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pYlhWc2RHa3RZWEJ3TFdKaFkydDFjQzFoYm1RdGNtVnpkRzl5WlMweUluMHNJbk53WldNaU9uc2liR2xqWlc1elpVbEVJam9pTWxBemNuVTJhMUJzVURabVkxZGlZV3BCWlRsU1ZteDJhRWhNSWl3aWJHbGpaVzV6WlZSNWNHVWlPaUprWlhZaUxDSmpkWE4wYjIxbGNrNWhiV1VpT2lKdGRXeDBhUzFoY0hBdFltRmphM1Z3TFdGdVpDMXlaWE4wYjNKbExUSWlMQ0poY0hCVGJIVm5Jam9pYlhWc2RHa3RZWE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B0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts b/e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts new file mode 100644 index 0000000000..2a3ec5805c --- /dev/null +++ b/e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts @@ -0,0 +1,40 @@ +import { test, expect } from '@playwright/test'; +import { login, uploadLicense } from '../shared'; + +test('multi app backup and restore', async ({ page }) => { + test.slow(); + await login(page); + await uploadLicense(page, expect, "app1-license.yaml"); + await expect(page.locator('#app')).toContainText('Multi App Backup and Restore 1', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 }); + await expect(page.locator('#app')).toContainText('Currently deployed version'); + await page.locator('div').filter({ hasText: /^Change passwordAdd new applicationLog out$/ }).getByRole('img').click(); + await page.getByText('Add new application').click(); + await uploadLicense(page, expect, "app2-license.yaml"); + await expect(page.locator('#app')).toContainText('Multi App Backup and Restore 2', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 }); + await expect(page.locator('#app')).toContainText('Currently deployed version'); + await page.locator('.NavItem').getByText('Snapshots', { exact: true }).click(); + await page.getByRole('link', { name: 'Partial Snapshots' }).click({ timeout: 10000 }); + await page.getByRole('button', { name: 'Start a snapshot' }).click({ timeout: 15000 }); + await expect(page.locator('#app')).toContainText('Completed', { timeout: 30000 }); + await page.locator('.replicated-select__control').click(); + await page.waitForTimeout(1000); + await page.locator('.replicated-select__option').getByText('Multi App Backup and Restore 2', { exact: true }).click(); + await page.waitForTimeout(1000); + await expect(page.locator('#app')).toContainText('No snapshots yet', { timeout: 15000 }); + await page.getByRole('button', { name: 'Start a snapshot' }).click(); + await expect(page.locator('#app')).toContainText('Completed', { timeout: 30000 }); + await page.locator('svg.icons.clickable[data-tip="Restore from this backup"]').click(); + await page.getByPlaceholder('type your slug').fill('multi-app-backup-and-restore-2'); + await page.getByRole('button', { name: 'Confirm and restore' }).click(); + await page.getByRole('button', { name: 'Cancel snapshot restore' }).click(); + await page.locator('.replicated-select__control').click({ timeout: 15000 }); + await page.waitForTimeout(1000); + await page.locator('.replicated-select__option').getByText('Multi App Backup and Restore 1', { exact: true }).click(); + await page.waitForTimeout(1000); + await page.locator('svg.icons.clickable[data-tip="Restore from this backup"]').click({ timeout: 15000 }); + await page.getByPlaceholder('type your slug').fill('multi-app-backup-and-restore-1'); + await page.getByRole('button', { name: 'Confirm and restore' }).click(); + await page.getByRole('button', { name: 'Cancel snapshot restore' }).click(); +}); From 8c21a74576d7b1e9496cac31775f1c920359dd86 Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Thu, 26 Sep 2024 11:52:38 -0700 Subject: [PATCH 2/4] make test ids exact matches --- e2e/README.md | 6 +++--- e2e/inventory/inventory.go | 14 +++++++------- .../license.yaml | 0 .../test.spec.ts | 0 .../license.yaml | 0 .../test.spec.ts | 0 .../invalid-jwt.txt | 0 .../license.yaml | 0 .../test.spec.ts | 0 .../valid-jwt.txt | 0 .../app1-license.yaml | 0 .../app2-license.yaml | 0 .../test.spec.ts | 0 .../app1-license.yaml | 0 .../app2-license.yaml | 0 .../test.spec.ts | 0 .../license.yaml | 0 .../test.spec.ts | 0 .../tests/{smoke-test => @smoke-test}/license.yaml | 0 .../tests/{smoke-test => @smoke-test}/test.spec.ts | 0 kurl_proxy/Makefile | 2 +- 21 files changed, 11 insertions(+), 11 deletions(-) rename e2e/playwright/tests/{backup-and-restore => @backup-and-restore}/license.yaml (100%) rename e2e/playwright/tests/{backup-and-restore => @backup-and-restore}/test.spec.ts (100%) rename e2e/playwright/tests/{change-channel => @change-channel}/license.yaml (100%) rename e2e/playwright/tests/{change-channel => @change-channel}/test.spec.ts (100%) rename e2e/playwright/tests/{config-validation => @config-validation}/invalid-jwt.txt (100%) rename e2e/playwright/tests/{config-validation => @config-validation}/license.yaml (100%) rename e2e/playwright/tests/{config-validation => @config-validation}/test.spec.ts (100%) rename e2e/playwright/tests/{config-validation => @config-validation}/valid-jwt.txt (100%) rename e2e/playwright/tests/{multi-app-backup-and-restore => @multi-app-backup-and-restore}/app1-license.yaml (100%) rename e2e/playwright/tests/{multi-app-backup-and-restore => @multi-app-backup-and-restore}/app2-license.yaml (100%) rename e2e/playwright/tests/{multi-app-backup-and-restore => @multi-app-backup-and-restore}/test.spec.ts (100%) rename e2e/playwright/tests/{multi-app-install => @multi-app-install}/app1-license.yaml (100%) rename e2e/playwright/tests/{multi-app-install => @multi-app-install}/app2-license.yaml (100%) rename e2e/playwright/tests/{multi-app-install => @multi-app-install}/test.spec.ts (100%) rename e2e/playwright/tests/{no-required-config => @no-required-config}/license.yaml (100%) rename e2e/playwright/tests/{no-required-config => @no-required-config}/test.spec.ts (100%) rename e2e/playwright/tests/{smoke-test => @smoke-test}/license.yaml (100%) rename e2e/playwright/tests/{smoke-test => @smoke-test}/test.spec.ts (100%) diff --git a/e2e/README.md b/e2e/README.md index d510802ca2..f8cd71ede1 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -34,7 +34,7 @@ To add a new test that you've already added in the [kots-tests-app repo](https:/ ```go func NewChangeChannel() Test { return Test{ - ID: "change-channel", + ID: "@change-channel", Name: "Change Channel", Namespace: "change-channel", AppSlug: "change-channel", @@ -52,8 +52,8 @@ Entry(nil, inventory.NewChangeChannel()), - Create a new test directory in `e2e/playwright/tests` matching your test ID, with the corresponding test file: ``` -$ tree e2e/playwright/tests/change-channel -e2e/playwright/tests/change-channel +$ tree e2e/playwright/tests/@change-channel +e2e/playwright/tests/@change-channel ├── license.yaml // a test specific license if needed └── test.spec.ts // the actual test file ``` diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index 0180f067b9..ff96200266 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -35,7 +35,7 @@ func NewRegressionTest() Test { func NewSmokeTest() Test { return Test{ - ID: "smoke-test", + ID: "@smoke-test", Name: "Smoke Test", Namespace: "smoke-test", AppSlug: "qakotstestim", @@ -55,7 +55,7 @@ func NewAirgapSmokeTest() Test { func NewConfigValidation() Test { return Test{ - ID: "config-validation", + ID: "@config-validation", Name: "Config Validation", Namespace: "config-validation", AppSlug: "config-validation-panda", @@ -65,7 +65,7 @@ func NewConfigValidation() Test { func NewBackupAndRestore() Test { return Test{ - ID: "backup-and-restore", + ID: "@backup-and-restore", Name: "Backup and Restore", Namespace: "backup-and-restore", AppSlug: "backup-and-restore", @@ -76,7 +76,7 @@ func NewBackupAndRestore() Test { func NewNoRequiredConfig() Test { return Test{ - ID: "no-required-config", + ID: "@no-required-config", Name: "No Required Config", Namespace: "no-required-config", AppSlug: "no-required-config", @@ -104,7 +104,7 @@ func NewChangeLicense() Test { func NewMultiAppBackupAndRestoreTest() Test { return Test{ - ID: "multi-app-backup-and-restore", + ID: "@multi-app-backup-and-restore", Name: "Multi App Backup and Restore", Namespace: "multi-app-backup-and-restore", AppSlug: "multi-app-backup-and-restore", @@ -115,7 +115,7 @@ func NewMultiAppBackupAndRestoreTest() Test { func MultiAppTest() Test { return Test{ - ID: "multi-app-install", + ID: "@multi-app-install", Name: "Multi App Install", Namespace: "multi-app-install", AppSlug: "mutli-app-install", @@ -173,7 +173,7 @@ func NewGitOps() Test { func NewChangeChannel() Test { return Test{ - ID: "change-channel", + ID: "@change-channel", Name: "Change Channel", Namespace: "change-channel", AppSlug: "change-channel", diff --git a/e2e/playwright/tests/backup-and-restore/license.yaml b/e2e/playwright/tests/@backup-and-restore/license.yaml similarity index 100% rename from e2e/playwright/tests/backup-and-restore/license.yaml rename to e2e/playwright/tests/@backup-and-restore/license.yaml diff --git a/e2e/playwright/tests/backup-and-restore/test.spec.ts b/e2e/playwright/tests/@backup-and-restore/test.spec.ts similarity index 100% rename from e2e/playwright/tests/backup-and-restore/test.spec.ts rename to e2e/playwright/tests/@backup-and-restore/test.spec.ts diff --git a/e2e/playwright/tests/change-channel/license.yaml b/e2e/playwright/tests/@change-channel/license.yaml similarity index 100% rename from e2e/playwright/tests/change-channel/license.yaml rename to e2e/playwright/tests/@change-channel/license.yaml diff --git a/e2e/playwright/tests/change-channel/test.spec.ts b/e2e/playwright/tests/@change-channel/test.spec.ts similarity index 100% rename from e2e/playwright/tests/change-channel/test.spec.ts rename to e2e/playwright/tests/@change-channel/test.spec.ts diff --git a/e2e/playwright/tests/config-validation/invalid-jwt.txt b/e2e/playwright/tests/@config-validation/invalid-jwt.txt similarity index 100% rename from e2e/playwright/tests/config-validation/invalid-jwt.txt rename to e2e/playwright/tests/@config-validation/invalid-jwt.txt diff --git a/e2e/playwright/tests/config-validation/license.yaml b/e2e/playwright/tests/@config-validation/license.yaml similarity index 100% rename from e2e/playwright/tests/config-validation/license.yaml rename to e2e/playwright/tests/@config-validation/license.yaml diff --git a/e2e/playwright/tests/config-validation/test.spec.ts b/e2e/playwright/tests/@config-validation/test.spec.ts similarity index 100% rename from e2e/playwright/tests/config-validation/test.spec.ts rename to e2e/playwright/tests/@config-validation/test.spec.ts diff --git a/e2e/playwright/tests/config-validation/valid-jwt.txt b/e2e/playwright/tests/@config-validation/valid-jwt.txt similarity index 100% rename from e2e/playwright/tests/config-validation/valid-jwt.txt rename to e2e/playwright/tests/@config-validation/valid-jwt.txt diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml b/e2e/playwright/tests/@multi-app-backup-and-restore/app1-license.yaml similarity index 100% rename from e2e/playwright/tests/multi-app-backup-and-restore/app1-license.yaml rename to e2e/playwright/tests/@multi-app-backup-and-restore/app1-license.yaml diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml b/e2e/playwright/tests/@multi-app-backup-and-restore/app2-license.yaml similarity index 100% rename from e2e/playwright/tests/multi-app-backup-and-restore/app2-license.yaml rename to e2e/playwright/tests/@multi-app-backup-and-restore/app2-license.yaml diff --git a/e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts b/e2e/playwright/tests/@multi-app-backup-and-restore/test.spec.ts similarity index 100% rename from e2e/playwright/tests/multi-app-backup-and-restore/test.spec.ts rename to e2e/playwright/tests/@multi-app-backup-and-restore/test.spec.ts diff --git a/e2e/playwright/tests/multi-app-install/app1-license.yaml b/e2e/playwright/tests/@multi-app-install/app1-license.yaml similarity index 100% rename from e2e/playwright/tests/multi-app-install/app1-license.yaml rename to e2e/playwright/tests/@multi-app-install/app1-license.yaml diff --git a/e2e/playwright/tests/multi-app-install/app2-license.yaml b/e2e/playwright/tests/@multi-app-install/app2-license.yaml similarity index 100% rename from e2e/playwright/tests/multi-app-install/app2-license.yaml rename to e2e/playwright/tests/@multi-app-install/app2-license.yaml diff --git a/e2e/playwright/tests/multi-app-install/test.spec.ts b/e2e/playwright/tests/@multi-app-install/test.spec.ts similarity index 100% rename from e2e/playwright/tests/multi-app-install/test.spec.ts rename to e2e/playwright/tests/@multi-app-install/test.spec.ts diff --git a/e2e/playwright/tests/no-required-config/license.yaml b/e2e/playwright/tests/@no-required-config/license.yaml similarity index 100% rename from e2e/playwright/tests/no-required-config/license.yaml rename to e2e/playwright/tests/@no-required-config/license.yaml diff --git a/e2e/playwright/tests/no-required-config/test.spec.ts b/e2e/playwright/tests/@no-required-config/test.spec.ts similarity index 100% rename from e2e/playwright/tests/no-required-config/test.spec.ts rename to e2e/playwright/tests/@no-required-config/test.spec.ts diff --git a/e2e/playwright/tests/smoke-test/license.yaml b/e2e/playwright/tests/@smoke-test/license.yaml similarity index 100% rename from e2e/playwright/tests/smoke-test/license.yaml rename to e2e/playwright/tests/@smoke-test/license.yaml diff --git a/e2e/playwright/tests/smoke-test/test.spec.ts b/e2e/playwright/tests/@smoke-test/test.spec.ts similarity index 100% rename from e2e/playwright/tests/smoke-test/test.spec.ts rename to e2e/playwright/tests/@smoke-test/test.spec.ts diff --git a/kurl_proxy/Makefile b/kurl_proxy/Makefile index 9fac8b1cf7..d79947a014 100644 --- a/kurl_proxy/Makefile +++ b/kurl_proxy/Makefile @@ -18,5 +18,5 @@ run: build-ttl.sh: export GOOS ?= linux build-ttl.sh: export GOARCH ?= amd64 build-ttl.sh: build - docker build --platform $(GOOS)/$(GOARCH) --pull -f dev/Dockerfile.ttlsh -t ttl.sh/${CURRENT_USER}/kurl-proxy:24h . + docker build --platform $(GOOS)/$(GOARCH) --pull -f ../dev/dockerfiles/kurl-proxy/Dockerfile.ttlsh -t ttl.sh/${CURRENT_USER}/kurl-proxy:24h . docker push ttl.sh/${CURRENT_USER}/kurl-proxy:24h From 426f5684b29add262b6a09d95681da2bada8d7fb Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Thu, 26 Sep 2024 13:36:05 -0700 Subject: [PATCH 3/4] updates --- .github/actions/kots-e2e/action.yml | 8 ++++---- .github/workflows/build-test.yaml | 32 ++++++++++++++--------------- e2e/README.md | 11 +++++----- e2e/e2e_test.go | 11 +++++++--- e2e/inventory/inventory.go | 25 ++++++++-------------- e2e/inventory/test.go | 1 - 6 files changed, 42 insertions(+), 46 deletions(-) diff --git a/.github/actions/kots-e2e/action.yml b/.github/actions/kots-e2e/action.yml index 4dc16afeca..9ca204ed26 100644 --- a/.github/actions/kots-e2e/action.yml +++ b/.github/actions/kots-e2e/action.yml @@ -1,8 +1,8 @@ name: 'KOTS E2E' description: 'Composite action for running KOTS e2e test' inputs: - test-focus: - description: 'Name of the test for FOCUS' + test-id: + description: 'ID of the test to run' required: true kots-namespace: description: 'KOTS namespace' @@ -92,14 +92,14 @@ runs: instance-type: ${{ inputs.k8s-instance-type }} export-kubeconfig: true - - name: execute suite "${{ inputs.test-focus }}" + - name: execute suite "${{ inputs.test-id }}" env: TESTIM_ACCESS_TOKEN: ${{ inputs.testim-access-token }} REPLICATED_API_TOKEN: ${{ inputs.replicated-api-token }} KOTS_NAMESPACE: ${{ inputs.kots-namespace }} run: | make -C e2e test \ - FOCUS="${{ inputs.test-focus }}" \ + FOCUS="${{ inputs.test-id }}" \ EXISTING_KUBECONFIG=$KUBECONFIG \ TESTIM_BRANCH=${{ inputs.testim-branch }} \ KOTSADM_IMAGE_REGISTRY=${{ inputs.kotsadm-image-registry }} \ diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index ee7ad4d325..79b5cbabed 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -592,7 +592,7 @@ jobs: - uses: ./.github/actions/kots-e2e with: kots-namespace: 'qakotsregression' - test-focus: 'Regression' + test-id: '@regression' k8s-distribution: k3s k8s-version: v1.26 testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} @@ -628,7 +628,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Smoke Test' + test-id: '@smoke-test' kots-namespace: 'smoke-test' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -846,7 +846,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Backup and Restore' + test-id: '@backup-and-restore' kots-namespace: 'backup-and-restore' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -883,7 +883,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'No Required Config' + test-id: '@no-required-config' kots-namespace: 'no-required-config' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -1073,7 +1073,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Config Validation' + test-id: '@config-validation' kots-namespace: 'config-validation' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -1109,7 +1109,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Version History Pagination' + test-id: '@version-history-pagination' kots-namespace: 'version-history-pagination' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -1146,7 +1146,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Change License' + test-id: '@change-license' kots-namespace: 'change-license' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -1183,7 +1183,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Change Channel' + test-id: '@change-channel' kots-namespace: 'change-channel' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2338,7 +2338,7 @@ jobs: - uses: ./.github/actions/kots-e2e id: kots-e2e with: - test-focus: 'Min KOTS Version' + test-id: '@min-kots-version' kots-namespace: 'min-kots-version' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2404,7 +2404,7 @@ jobs: - uses: ./.github/actions/kots-e2e id: kots-e2e with: - test-focus: 'Target KOTS Version' + test-id: '@target-kots-version' kots-namespace: 'target-kots-version' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2469,7 +2469,7 @@ jobs: - uses: ./.github/actions/kots-e2e id: kots-e2e with: - test-focus: 'Range KOTS Version' + test-id: '@range-kots-version' kots-namespace: 'range-kots-version' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2857,7 +2857,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Multi App Backup and Restore' + test-id: '@multi-app-backup-and-restore' kots-namespace: 'multi-app-backup-and-restore' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2893,7 +2893,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Multi App Install' + test-id: '@multi-app-install' kots-namespace: 'multi-app-install' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -2929,7 +2929,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'airgap-smoke-test' + test-id: '@airgap-smoke-test' kots-namespace: 'airgap-smoke-test' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -3942,7 +3942,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'Support Bundle' + test-id: '@support-bundle' kots-namespace: 'support-bundle' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} @@ -3980,7 +3980,7 @@ jobs: - run: chmod +x bin/* - uses: ./.github/actions/kots-e2e with: - test-focus: 'GitOps' + test-id: '@gitops' kots-namespace: 'gitops' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} diff --git a/e2e/README.md b/e2e/README.md index f8cd71ede1..0e73d75d68 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -4,7 +4,7 @@ E2E tests are run in build-test workflow on pull_request event. e2e_test.go uses Ginkgo to build a test suite from inventory.go and runs each test using testim/client.go or playwright/playwright.go -Tests are parallelized using Gingko's test focus. Each workflow definition in .github/workflows/build-test.yaml must define a `test-focus` parameter that matches the `Test Name` property defined in inventory.go. Each e2e test workflow skips all tests but what is defined in `test-focus`. Please colocate new Playwright tests under the Playwright comment with the other pw tests. +Tests are parallelized using Gingko's test focus. Each workflow definition in .github/workflows/build-test.yaml must define a `test-id` parameter that matches the `Test ID` property defined in inventory.go. Each e2e test workflow skips all tests but what is defined in `test-id`. Please colocate new Playwright tests under the Playwright comment with the other pw tests. New tests should be written with Playwright. @@ -28,14 +28,13 @@ code --install-extension ms-playwright.playwright To add a new test that you've already added in the [kots-tests-app repo](https://github.com/replicatedhq/kots-test-apps) - do the following: -- Update `.github/workflows/build-test.yaml` to include the new test. You can copy an existing pw entry like `validate-change-channel` and update the test-focus, kots-namespace, and any other parameters needed for the test. +- Update `.github/workflows/build-test.yaml` to include the new test. You can copy an existing pw entry like `validate-change-channel` and update the `test-id`, kots-namespace, and any other parameters needed for the test. - Add the test to `e2e/inventory.go` , making sure the naming matches your kots-test-app and conforms to the naming convention of the other tests in the file: ```go func NewChangeChannel() Test { return Test{ ID: "@change-channel", - Name: "Change Channel", Namespace: "change-channel", AppSlug: "change-channel", UpstreamURI: "change-channel/automated", @@ -77,7 +76,7 @@ To run an individual test run: ```bash make e2e \ - FOCUS="Change License" + FOCUS="@change-license" ``` To build and run with ttl.sh images: @@ -103,7 +102,7 @@ To run against the okteto dev environment run: ```bash okteto context use https://replicated.okteto.dev make e2e \ - FOCUS="Change License" \ + FOCUS="@change-license" \ EXISTING_KUBECONFIG=${KUBECONFIG:-$HOME/.kube/config} ``` @@ -113,7 +112,7 @@ To skip cluster teardown in order to debug issues: ```bash $ make e2e \ - FOCUS="Change License" \ + FOCUS="@change-license" \ SKIP_TEARDOWN=1 ... To set kubecontext run: diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 0abfca8436..f822244d0e 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -101,6 +101,13 @@ var _ = BeforeSuite(func() { kotsInstaller = kots.NewInstaller(kotsadmImageRegistry, kotsadmImageNamespace, kotsadmImageTag, airgap, kotsDockerhubUsername, kotsDockerhubPassword, isEKS) }) +var _ = ReportBeforeSuite(func(report Report) { + count := report.PreRunStats.SpecsThatWillRun + if count == 0 { + Fail("Did not match any tests") + } +}) + var _ = AfterSuite(func() { gexec.KillAndWait() }) @@ -204,7 +211,7 @@ var _ = Describe("E2E", func() { testimRun.ShouldSucceed() }, func(test inventory.Test) string { - return test.Name + return test.ID }, Entry(nil, inventory.NewRegressionTest()), Entry(nil, inventory.NewSmokeTest()), @@ -223,7 +230,5 @@ var _ = Describe("E2E", func() { Entry(nil, inventory.NewGitOps()), Entry(nil, inventory.NewChangeChannel()), ) - }) - }) diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index ff96200266..c456d99449 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -21,7 +21,7 @@ const ( func NewRegressionTest() Test { return Test{ - Name: "Regression", + ID: "@regression", TestimLabel: "type=existing cluster, env=online, phase=new install, rbac=minimal rbac", Namespace: "qakotsregression", UpstreamURI: "qakotsregression/type-existing-cluster-env-on-2", @@ -36,7 +36,6 @@ func NewRegressionTest() Test { func NewSmokeTest() Test { return Test{ ID: "@smoke-test", - Name: "Smoke Test", Namespace: "smoke-test", AppSlug: "qakotstestim", UpstreamURI: "qakotstestim/github-actions-qa", @@ -46,7 +45,7 @@ func NewSmokeTest() Test { func NewAirgapSmokeTest() Test { return Test{ - Name: "airgap-smoke-test", + ID: "@airgap-smoke-test", TestimSuite: "airgap-smoke-test", Namespace: "airgap-smoke-test", UpstreamURI: "airgap-smoke-test/automated", @@ -56,7 +55,6 @@ func NewAirgapSmokeTest() Test { func NewConfigValidation() Test { return Test{ ID: "@config-validation", - Name: "Config Validation", Namespace: "config-validation", AppSlug: "config-validation-panda", UpstreamURI: "config-validation-panda/automated", @@ -66,7 +64,6 @@ func NewConfigValidation() Test { func NewBackupAndRestore() Test { return Test{ ID: "@backup-and-restore", - Name: "Backup and Restore", Namespace: "backup-and-restore", AppSlug: "backup-and-restore", UpstreamURI: "backup-and-restore/automated", @@ -77,7 +74,6 @@ func NewBackupAndRestore() Test { func NewNoRequiredConfig() Test { return Test{ ID: "@no-required-config", - Name: "No Required Config", Namespace: "no-required-config", AppSlug: "no-required-config", UpstreamURI: "no-required-config/automated", @@ -86,7 +82,7 @@ func NewNoRequiredConfig() Test { func NewVersionHistoryPagination() Test { return Test{ - Name: "Version History Pagination", + ID: "@version-history-pagination", TestimSuite: "version-history-pagination", Namespace: "version-history-pagination", UpstreamURI: "version-history-pagination/automated", @@ -95,7 +91,7 @@ func NewVersionHistoryPagination() Test { func NewChangeLicense() Test { return Test{ - Name: "Change License", + ID: "@change-license", TestimSuite: "change-license", Namespace: "change-license", UpstreamURI: "change-license/automated", @@ -105,7 +101,6 @@ func NewChangeLicense() Test { func NewMultiAppBackupAndRestoreTest() Test { return Test{ ID: "@multi-app-backup-and-restore", - Name: "Multi App Backup and Restore", Namespace: "multi-app-backup-and-restore", AppSlug: "multi-app-backup-and-restore", UpstreamURI: "multi-app-backup-and-restore/automated", @@ -116,7 +111,6 @@ func NewMultiAppBackupAndRestoreTest() Test { func MultiAppTest() Test { return Test{ ID: "@multi-app-install", - Name: "Multi App Install", Namespace: "multi-app-install", AppSlug: "mutli-app-install", UpstreamURI: "mutli-app-install/automated", @@ -125,7 +119,7 @@ func MultiAppTest() Test { func NewMinKotsVersion() Test { return Test{ - Name: "Min KOTS Version", + ID: "@min-kots-version", TestimSuite: "min-kots-version", Namespace: "min-kots-version", UpstreamURI: "min-kots-version/automated", @@ -135,7 +129,7 @@ func NewMinKotsVersion() Test { func NewTargetKotsVersion() Test { return Test{ - Name: "Target KOTS Version", + ID: "@target-kots-version", TestimSuite: "target-kots-version", Namespace: "target-kots-version", UpstreamURI: "target-kots-version/automated", @@ -145,7 +139,7 @@ func NewTargetKotsVersion() Test { func NewRangeKotsVersion() Test { return Test{ - Name: "Range KOTS Version", + ID: "@range-kots-version", TestimSuite: "range-kots-version", Namespace: "range-kots-version", UpstreamURI: "range-kots-version/automated", @@ -155,7 +149,7 @@ func NewRangeKotsVersion() Test { func NewSupportBundle() Test { return Test{ - Name: "Support Bundle", + ID: "@support-bundle", TestimSuite: "support-bundle", Namespace: "support-bundle", UpstreamURI: "support-bundle-halibut/automated", @@ -164,7 +158,7 @@ func NewSupportBundle() Test { func NewGitOps() Test { return Test{ - Name: "GitOps", + ID: "@gitops", TestimSuite: "gitops", Namespace: "gitops", UpstreamURI: "gitops-bobcat/automated", @@ -174,7 +168,6 @@ func NewGitOps() Test { func NewChangeChannel() Test { return Test{ ID: "@change-channel", - Name: "Change Channel", Namespace: "change-channel", AppSlug: "change-channel", UpstreamURI: "change-channel/automated", diff --git a/e2e/inventory/test.go b/e2e/inventory/test.go index 1fe11735d0..2f198e20ad 100644 --- a/e2e/inventory/test.go +++ b/e2e/inventory/test.go @@ -6,7 +6,6 @@ type TestimParams map[string]interface{} type Test struct { ID string // must match directory name in e2e/playwright/tests - Name string // must match test-focus in .github/workflows/build-test.yaml TestimSuite string TestimLabel string Namespace string From 2a43ca9742794f11f2d831e7e15854aa5f4ddf2a Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Thu, 26 Sep 2024 14:25:03 -0700 Subject: [PATCH 4/4] fix flaky change-channel test --- e2e/playwright/tests/@change-channel/test.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/playwright/tests/@change-channel/test.spec.ts b/e2e/playwright/tests/@change-channel/test.spec.ts index 0b827e3d2f..b1626e70d2 100644 --- a/e2e/playwright/tests/@change-channel/test.spec.ts +++ b/e2e/playwright/tests/@change-channel/test.spec.ts @@ -23,13 +23,15 @@ test('change channel', async ({ page }) => { await expect(page.locator('#app')).toContainText('Alternate'); await expect(page.locator('#app')).toContainText('v1.0.1', { timeout: 10000 }); await expect(page.locator('#app')).toContainText('Upstream Update', { timeout: 10000 }); + await expect(page.locator('#app')).not.toContainText('Running checks', { timeout: 10000 }); await page.getByRole('button', { name: 'Deploy', exact: true }).click(); await page.getByRole('button', { name: 'Yes, Deploy' }).click(); + await expect(page.locator('#app')).toContainText('Deploying', { timeout: 10000 }); await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 }); - await expect(page.getByText('v1.0.0')).not.toBeVisible(); - await expect(page.getByText('v1.0.1')).toBeVisible(); + await expect(page.locator('#app')).not.toContainText('v1.0.0'); + await expect(page.locator('#app')).toContainText('v1.0.1'); }); async function changeChannel(channelId: string) {