-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add change channel e2e test #4800
Closed
Closed
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e7941e5
Add change channel e2e test
pandemicsyn 5e2f0ed
Include validate on pr
pandemicsyn 239e963
Add change channel to inventory.go
pandemicsyn c12e856
Actually maybe invoke it
pandemicsyn cd77e09
Switch to playwright
pandemicsyn 0b95e0e
update license
pandemicsyn d265375
Merge branch 'main' into florian/chore/change-channel-e2e
pandemicsyn 0a57d1a
Wait for preflights maybe
pandemicsyn 9dcec3f
remove unneeded waitForTimeout
pandemicsyn b19ab97
Merge branch 'main' into florian/chore/change-channel-e2e
pandemicsyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: kots.io/v1beta1 | ||
kind: License | ||
metadata: | ||
name: github-action | ||
spec: | ||
appSlug: change-channel | ||
channelID: 2k6j62KPRQLjO0tF9zZB6zJJukg | ||
channelName: Automated | ||
channels: | ||
- channelID: 2k6j62KPRQLjO0tF9zZB6zJJukg | ||
channelName: Automated | ||
channelSlug: automated | ||
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: 16 | ||
licenseType: trial | ||
signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pWjJsMGFIVmlMV0ZqZEdsdmJpSjlMQ0p6Y0dWaklqcDdJbXhwWTJWdWMyVkpSQ0k2SWpKck5tcGxiWEJqUWpaaFVYbGtaR05KUlVKVFZHb3dRbloyZGlJc0lteHBZMlZ1YzJWVWVYQmxJam9pZEhKcFlXd2lMQ0pqZFhOMGIyMWxjazVoYldVaU9pSm5hWFJvZFdJdFlXTjBhVzl1SWl3aVlYQndVMngxWnlJNkltTm9ZVzVuWlMxamFHRnVibVZzSWl3aVkyaGhibTVsYkVsRUlqb2lNbXMyYWpZeVMxQlNVVXhxVHpCMFJqbDZXa0kyZWtwS2RXdG5JaXdpWTJoaGJtNWxiRTVoYldVaU9pSkJkWFJ2YldGMFpXUWlMQ0pqYUdGdWJtVnNjeUk2VzNzaVkyaGhibTVsYkVsRUlqb2lNbXMyYWpZeVMxQlNVVXhxVHpCMFJqbDZXa0kyZWtwS2RXdG5JaXdpWTJoaGJtNWxiRk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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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
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 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'); | ||
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('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.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: string) { | ||
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}`); | ||
} | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as sorry , this may actually not be needed anymore since I just removed the preflight checks from the alternate channel. Originally was using this to try and give the preflight checks a chance to complete. Let me remove it and see if theres remaining timing issues.