Skip to content

Commit

Permalink
Merge branch 'develop' into feat/pipeline-target-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
m8vago committed Jan 7, 2025
2 parents e0bba87 + b8e4652 commit dee233c
Show file tree
Hide file tree
Showing 45 changed files with 397 additions and 369 deletions.
2 changes: 1 addition & 1 deletion web/crux-ui/e2e/utils/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const createImage = async (page: Page, projectId: string, versionId: stri
const settingsButton = await page.waitForSelector(`[src="/container_config.svg"]:right-of(:text("${image}"))`)
await settingsButton.click()

await page.waitForSelector(`h2:has-text("Image")`)
await page.waitForSelector(`h2:has-text("Image config")`)

return page.url().split('/').pop()
}
Expand Down
33 changes: 18 additions & 15 deletions web/crux-ui/e2e/with-login/container-config/common-editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const name = 'new-container-name'

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchContainerName(name))
await page.locator('button:has-text("Name")').click()
await page.locator('input[placeholder="Container name"]').fill(name)
await wsSent

Expand All @@ -64,11 +65,12 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchExpose('exposeWithTls'))
await page.locator('button:has-text("Expose")').click()
await page.getByRole('button', { name: 'HTTPS', exact: true }).click()
await wsSent

Expand All @@ -82,13 +84,14 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const user = 23

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchUser(user))
await page.locator('button:has-text("User")').click()
await page.locator('input[placeholder="Container default"]').fill(user.toString())
await wsSent

Expand All @@ -102,7 +105,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -122,7 +125,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -152,7 +155,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -195,7 +198,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -221,7 +224,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -244,7 +247,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -266,7 +269,7 @@ test.describe('Image common config from editor', () => {
const { imageConfigId } = await setup(page, 'routing-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -317,7 +320,7 @@ test.describe('Image common config from editor', () => {
const { imageConfigId } = await setup(page, 'environment-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -341,7 +344,7 @@ test.describe('Image common config from editor', () => {
const { imageConfigId } = await setup(page, 'config-container-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -371,7 +374,7 @@ test.describe('Image common config from editor', () => {
const { imageConfigId } = await setup(page, 'init-container-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -424,7 +427,7 @@ test.describe('Image common config from editor', () => {
const { imageConfigId } = await setup(page, 'volume-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -462,7 +465,7 @@ test.describe('Image common config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('Filters', () => {
const { imageConfigId } = await setup(page, 'filter-all', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

const allButton = await page.locator('button:has-text("All")')

Expand All @@ -33,7 +33,7 @@ test.describe('Filters', () => {
const { imageConfigId } = await setup(page, 'filter-select', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

await page.locator(`button:has-text("Common")`).first().click()

Expand All @@ -46,7 +46,7 @@ test.describe('Filters', () => {
const { imageConfigId } = await setup(page, 'sub-filter', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

const subFilter = await page.locator(`button:has-text("Network mode")`)

Expand All @@ -61,7 +61,7 @@ test.describe('Filters', () => {
const { imageConfigId } = await setup(page, 'sub-deselect', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

const subFilter = await page.locator(`button:has-text("Deployment strategy")`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ test.describe('Image docker config from editor', () => {
const { imageConfigId } = await setup(page, 'networkmode-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const mode = 'host'

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchNetworkMode(mode))
await page.locator('button:has-text("Network mode")').click()
await page.locator(`div.grid:has(label:has-text("NETWORK MODE")) button:has-text("${mode}")`).click()
await wsSent

Expand All @@ -51,7 +52,7 @@ test.describe('Image docker config from editor', () => {
const { imageConfigId } = await setup(page, 'dockerlabel-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -77,11 +78,12 @@ test.describe('Image docker config from editor', () => {
const { imageConfigId } = await setup(page, 'restartpolicy-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchRestartPolicy('always'))
await page.locator('button:has-text("Restart policy")').click()
await page.locator('div.grid:has(label:has-text("RESTART POLICY")) button:has-text("Always")').click()
await wsSent

Expand All @@ -96,7 +98,7 @@ test.describe('Image docker config from editor', () => {
const { imageConfigId } = await setup(page, 'logconfig-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -125,7 +127,7 @@ test.describe('Image docker config from editor', () => {
const { imageConfigId } = await setup(page, 'networks-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down
10 changes: 5 additions & 5 deletions web/crux-ui/e2e/with-login/container-config/docker-json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Image docker config from JSON', () => {
const { imageConfigId } = await setup(page, 'networkmode-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -60,7 +60,7 @@ test.describe('Image docker config from JSON', () => {
const { imageConfigId } = await setup(page, 'dockerlabel-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -92,7 +92,7 @@ test.describe('Image docker config from JSON', () => {
const { imageConfigId } = await setup(page, 'restartpolicy-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -118,7 +118,7 @@ test.describe('Image docker config from JSON', () => {
const { imageConfigId } = await setup(page, 'logconfig-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -149,7 +149,7 @@ test.describe('Image docker config from JSON', () => {
const { imageConfigId } = await setup(page, 'networks-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('View state', () => {
const { imageConfigId } = await setup(page, 'editor-state-conf', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

const editorButton = await page.waitForSelector('button:has-text("Editor")')

Expand All @@ -38,7 +38,7 @@ test.describe('View state', () => {
const { imageConfigId } = await setup(page, 'editor-state-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)

await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')

const jsonEditorButton = await page.waitForSelector('button:has-text("JSON")')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

const strategy = 'rolling'

const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchDeploymentStrategy(strategy))
await page.locator('button:has-text("Deployment strategy")').click()
await page.locator(`button:has-text("${strategy}")`).click()
await wsSent

Expand All @@ -59,7 +60,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -84,7 +85,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand All @@ -104,7 +105,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -143,7 +144,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -180,7 +181,7 @@ test.describe('Image kubernetes config from editor', () => {
const { imageConfigId } = await setup(page, 'resource-config-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG)
const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -221,7 +222,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down Expand Up @@ -262,7 +263,7 @@ test.describe('Image kubernetes config from editor', () => {

const sock = waitSocketRef(page)
await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId))
await page.waitForSelector('h2:text-is("Image")')
await page.waitForSelector('h2:text-is("Image config")')
const ws = await sock
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId)

Expand Down
Loading

0 comments on commit dee233c

Please sign in to comment.