From e7941e55152c2dc32210f3fdfec6b1a9021527fd Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Fri, 2 Aug 2024 13:38:56 -0500 Subject: [PATCH 1/8] Add change channel e2e test --- .github/workflows/build-test.yaml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 40469c3027..0443721992 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -1085,6 +1085,42 @@ jobs: kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' + validate-change-channel: + runs-on: ubuntu-20.04 + needs: [ enable-tests, can-run-ci, build-kots, build-kotsadm, build-e2e, build-kurl-proxy, build-migrations, push-minio, push-rqlite ] + strategy: + fail-fast: false + matrix: + cluster: [ + {distribution: kind, version: v1.28.0} + ] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: download e2e deps + uses: actions/download-artifact@v4 + with: + name: e2e + path: e2e/bin/ + - run: docker load -i e2e/bin/e2e-deps.tar + - run: chmod +x e2e/bin/* + - name: download kots binary + uses: actions/download-artifact@v4 + with: + name: kots + path: bin/ + - run: chmod +x bin/* + - uses: ./.github/actions/kots-e2e + with: + test-focus: 'Change Channel' + kots-namespace: 'change-channel' + 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 }}' validate-minimal-rbac-override: runs-on: ubuntu-20.04 From 5e2f0ed651612c05c87ef0f49b9fb6349c2a9acd Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Fri, 2 Aug 2024 13:41:21 -0500 Subject: [PATCH 2/8] Include validate on pr --- .github/workflows/build-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 0443721992..75bda9959e 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -4153,6 +4153,7 @@ jobs: - validate-existing-online-install-minimal - validate-version-history-pagination - validate-change-license + - validate-change-channel - validate-min-kots-version - validate-target-kots-version - validate-range-kots-version From 239e963571de8fcf8c7eade70d60c0556de15126 Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Fri, 2 Aug 2024 17:58:51 -0500 Subject: [PATCH 3/8] Add change channel to inventory.go --- e2e/inventory/inventory.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index 7b2affdff8..4ee8971ec5 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -93,6 +93,15 @@ func NewVersionHistoryPagination() Test { } } +func NewChangeChannel() Test { + return Test{ + Name: "Change Channel", + TestimSuite: "change-channel", + Namespace: "change-channel", + UpstreamURI: "change-channel/automated", + } +} + func NewChangeLicense() Test { return Test{ Name: "Change License", From c12e8565aa5f35a66202cae5d5a71c27ac790710 Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Fri, 2 Aug 2024 18:22:08 -0500 Subject: [PATCH 4/8] Actually maybe invoke it --- e2e/e2e_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index ea47699c88..123fef3ef5 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -213,6 +213,7 @@ var _ = Describe("E2E", func() { Entry(nil, inventory.NewBackupAndRestore()), Entry(nil, inventory.NewNoRequiredConfig()), Entry(nil, inventory.NewVersionHistoryPagination()), + Entry(nil, inventory.NewChangeChannel()), Entry(nil, inventory.NewChangeLicense()), Entry(nil, inventory.NewMinKotsVersion()), Entry(nil, inventory.NewTargetKotsVersion()), From cd77e09a290e4efb970effbbea741039a58414cf Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Mon, 5 Aug 2024 16:02:44 -0500 Subject: [PATCH 5/8] Switch to playwright --- .github/actions/kots-e2e/action.yml | 1 + .github/workflows/build-test.yaml | 2 +- e2e/Makefile | 1 + e2e/inventory/inventory.go | 3 +- .../tests/change-channel/license.yaml | 29 +++++++++++ .../tests/change-channel/test.spec.ts | 52 +++++++++++++++++++ 6 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 e2e/playwright/tests/change-channel/license.yaml create mode 100644 e2e/playwright/tests/change-channel/test.spec.ts diff --git a/.github/actions/kots-e2e/action.yml b/.github/actions/kots-e2e/action.yml index 465fc7ee92..4dc16afeca 100644 --- a/.github/actions/kots-e2e/action.yml +++ b/.github/actions/kots-e2e/action.yml @@ -95,6 +95,7 @@ runs: - name: execute suite "${{ inputs.test-focus }}" 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 \ diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 75bda9959e..429440c727 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -4153,7 +4153,6 @@ jobs: - validate-existing-online-install-minimal - validate-version-history-pagination - validate-change-license - - validate-change-channel - validate-min-kots-version - validate-target-kots-version - validate-range-kots-version @@ -4167,6 +4166,7 @@ jobs: - validate-backup-and-restore - validate-no-required-config - validate-config + - validate-change-channel # non-testim tests - validate-minimal-rbac - validate-minimal-rbac-override diff --git a/e2e/Makefile b/e2e/Makefile index 846bcdb923..f1f8436de4 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -31,6 +31,7 @@ endif test: docker run --rm -i --net host \ -e TESTIM_ACCESS_TOKEN \ + -e REPLICATED_API_TOKEN \ -v $(BIN_DIR)/e2e.test:/usr/local/bin/e2e.test \ -v $(KOTS_BIN_DIR)/kots:/usr/local/bin/kots \ -v $(KOTS_BIN_DIR)/kots:/usr/local/bin/kubectl-kots \ diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index 4ee8971ec5..b8c486e171 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -95,9 +95,10 @@ func NewVersionHistoryPagination() Test { func NewChangeChannel() Test { return Test{ + ID: "change-channel", Name: "Change Channel", - TestimSuite: "change-channel", Namespace: "change-channel", + AppSlug: "change-channel", UpstreamURI: "change-channel/automated", } } diff --git a/e2e/playwright/tests/change-channel/license.yaml b/e2e/playwright/tests/change-channel/license.yaml new file mode 100644 index 0000000000..ec7eefa77b --- /dev/null +++ b/e2e/playwright/tests/change-channel/license.yaml @@ -0,0 +1,29 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: github-action +spec: + appSlug: change-channel + channelID: 2k6j61j49IPyDyQlbmRZJsxy3TP + channelName: Alternate + channels: + - channelID: 2k6j61j49IPyDyQlbmRZJsxy3TP + channelName: Alternate + channelSlug: alternate + endpoint: https://replicated.app + isDefault: true + customerName: github-action + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + signature: {} + title: Expiration + value: "" + valueType: String + isKotsInstallEnabled: true + isNewKotsUiEnabled: true + licenseID: 2k6jempcB6aQyddcIEBSTj0Bvvv + licenseSequence: 13 + licenseType: trial + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pWjJsMGFIVmlMV0ZqZEdsdmJpSjlMQ0p6Y0dWaklqcDdJbXhwWTJWdWMyVkpSQ0k2SWpKck5tcGxiWEJqUWpaaFVYbGtaR05KUlVKVFZHb3dRbloyZGlJc0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pjRzlOUlhSVFdrYzRkMVpJYkRaU2EzQkNVVzFKTTFKR1RucFRSVnBJVjFaYWJHUnJNWEZSTW5nMFdXczFORkpWZUZWT2JrWnNZMjFzYzFKSFRtMVVla0YzVWxkVk5XTklUVEZOYlVaRFZGUm9hMkpyU2toa1ZUZ3hUbXM1YjJJd1RqQmlSVTR4Vm01b2RsTXhaRFZYYWxGeVdqSmtSbFF6WXpsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/change-channel/test.spec.ts b/e2e/playwright/tests/change-channel/test.spec.ts new file mode 100644 index 0000000000..76eb421c78 --- /dev/null +++ b/e2e/playwright/tests/change-channel/test.spec.ts @@ -0,0 +1,52 @@ +import { test, expect } from '@playwright/test'; +import { login, uploadLicense } from '../shared'; + +const CUSTOMER_ID = '2k6jemHbYgZFqtwgyjqiVfjRQqi'; +const APP_ID = '2k6j65t0STtrZ1emyP5PUqBIQ23'; +const AUTOMATED_CHANNEL_ID = '2k6j62KPRQLjO0tF9zZB6zJJukg'; +const ALTERNATE_CHANNEL_ID = '2k6j61j49IPyDyQlbmRZJsxy3TP'; + +test('change channel', async ({ page }) => { + test.slow(); + await login(page); + await changeChannel(AUTOMATED_CHANNEL_ID); + await uploadLicense(page, expect); + await page.getByRole('button', { name: 'Deploy' }).click(); + await expect(page.locator('#app')).toContainText('Automated'); + await changeChannel(ALTERNATE_CHANNEL_ID); + await page.getByText('Sync license').click(); + await expect(page.getByLabel('Next step')).toContainText('License synced', { timeout: 10000 }); + await page.getByRole('button', { name: 'Ok, got it!' }).click(); + await expect(page.locator('#app')).toContainText('Alternate'); + await expect(page.locator('#app')).toContainText('v1.0.1', { timeout: 10000 }); + await page.getByRole('button', { name: 'Deploy', exact: true }).click(); + await page.getByRole('button', { name: 'Yes, Deploy' }).click(); + await expect(page.getByText('v1.0.0')).not.toBeVisible(); + await expect(page.getByText('v1.0.1')).toBeVisible(); + await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 }); +}); + +async function changeChannel(channelId) { + await fetch(`https://api.replicated.com/vendor/v3/customer/${CUSTOMER_ID}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + 'Authorization': process.env.REPLICATED_API_TOKEN, + }, + body: JSON.stringify({ + "app_id": APP_ID, + "name": "github-action", // customer name + "channels": [ + { + "channel_id": channelId, + "pinned_channel_sequence": null, + "is_default_for_customer": true + } + ] + }) + }).then(response => { + if (!response.ok) { + throw new Error(`Unexpected status code: ${response.status}`); + } + }); +} From 0b95e0e47f6227e0e28e34a8e18b0d7a44b69f7f Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Mon, 5 Aug 2024 16:28:27 -0500 Subject: [PATCH 6/8] update license --- e2e/playwright/tests/change-channel/license.yaml | 14 +++++++------- e2e/playwright/tests/change-channel/test.spec.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/e2e/playwright/tests/change-channel/license.yaml b/e2e/playwright/tests/change-channel/license.yaml index ec7eefa77b..6cdb43275b 100644 --- a/e2e/playwright/tests/change-channel/license.yaml +++ b/e2e/playwright/tests/change-channel/license.yaml @@ -4,12 +4,12 @@ metadata: name: github-action spec: appSlug: change-channel - channelID: 2k6j61j49IPyDyQlbmRZJsxy3TP - channelName: Alternate + channelID: 2k6j62KPRQLjO0tF9zZB6zJJukg + channelName: Automated channels: - - channelID: 2k6j61j49IPyDyQlbmRZJsxy3TP - channelName: Alternate - channelSlug: alternate + - channelID: 2k6j62KPRQLjO0tF9zZB6zJJukg + channelName: Automated + channelSlug: automated endpoint: https://replicated.app isDefault: true customerName: github-action @@ -24,6 +24,6 @@ spec: isKotsInstallEnabled: true isNewKotsUiEnabled: true licenseID: 2k6jempcB6aQyddcIEBSTj0Bvvv - licenseSequence: 13 + licenseSequence: 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pWZEtlVlpHYnpOaVIxSnpaRzVzYjJNd05XaGpTRlpYWTFST1VrNXNiSFZhTVdoMFRXNXdOVnBIWXpsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/change-channel/test.spec.ts b/e2e/playwright/tests/change-channel/test.spec.ts index 76eb421c78..3cc291e8fb 100644 --- a/e2e/playwright/tests/change-channel/test.spec.ts +++ b/e2e/playwright/tests/change-channel/test.spec.ts @@ -8,8 +8,8 @@ const ALTERNATE_CHANNEL_ID = '2k6j61j49IPyDyQlbmRZJsxy3TP'; test('change channel', async ({ page }) => { test.slow(); - await login(page); await changeChannel(AUTOMATED_CHANNEL_ID); + await login(page); await uploadLicense(page, expect); await page.getByRole('button', { name: 'Deploy' }).click(); await expect(page.locator('#app')).toContainText('Automated'); From 0a57d1a308035cf372afd0c48b3637ed6f9fde72 Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Mon, 5 Aug 2024 17:35:07 -0500 Subject: [PATCH 7/8] Wait for preflights maybe Alternate select fix dupes just use timeout Use exact match on deploy button Bump version --- e2e/playwright/tests/change-channel/test.spec.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/e2e/playwright/tests/change-channel/test.spec.ts b/e2e/playwright/tests/change-channel/test.spec.ts index 3cc291e8fb..f0466edaee 100644 --- a/e2e/playwright/tests/change-channel/test.spec.ts +++ b/e2e/playwright/tests/change-channel/test.spec.ts @@ -14,19 +14,27 @@ test('change channel', async ({ page }) => { await page.getByRole('button', { name: 'Deploy' }).click(); await expect(page.locator('#app')).toContainText('Automated'); await changeChannel(ALTERNATE_CHANNEL_ID); + await page.getByText('Sync license').click(); + await expect(page.getByLabel('Next step')).toContainText('License synced', { timeout: 10000 }); await page.getByRole('button', { name: 'Ok, got it!' }).click(); + await expect(page.locator('#app')).toContainText('Alternate'); - await expect(page.locator('#app')).toContainText('v1.0.1', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('1.0.3', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Upstream Update', { timeout: 10000 }); + + await page.waitForTimeout(5000); + await page.getByRole('button', { name: 'Deploy', exact: true }).click(); await page.getByRole('button', { name: 'Yes, Deploy' }).click(); - await expect(page.getByText('v1.0.0')).not.toBeVisible(); - await expect(page.getByText('v1.0.1')).toBeVisible(); + await expect(page.locator('#app')).toContainText('Currently deployed version', { timeout: 15000 }); + await expect(page.getByText('v1.0.0')).not.toBeVisible(); + await expect(page.getByText('1.0.3')).toBeVisible(); }); -async function changeChannel(channelId) { +async function changeChannel(channelId: string) { await fetch(`https://api.replicated.com/vendor/v3/customer/${CUSTOMER_ID}`, { method: 'PUT', headers: { From 9dcec3fdfaa6e4b4d1c86f68b234f5bee6af04ed Mon Sep 17 00:00:00 2001 From: pandemicsyn Date: Tue, 6 Aug 2024 11:01:19 -0500 Subject: [PATCH 8/8] remove unneeded waitForTimeout --- e2e/playwright/tests/change-channel/test.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/e2e/playwright/tests/change-channel/test.spec.ts b/e2e/playwright/tests/change-channel/test.spec.ts index f0466edaee..4556c20f6e 100644 --- a/e2e/playwright/tests/change-channel/test.spec.ts +++ b/e2e/playwright/tests/change-channel/test.spec.ts @@ -24,8 +24,6 @@ test('change channel', async ({ page }) => { await expect(page.locator('#app')).toContainText('1.0.3', { timeout: 10000 }); await expect(page.locator('#app')).toContainText('Upstream Update', { timeout: 10000 }); - await page.waitForTimeout(5000); - await page.getByRole('button', { name: 'Deploy', exact: true }).click(); await page.getByRole('button', { name: 'Yes, Deploy' }).click();