Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

e2e test in ci #208

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
57d3280
EVEREST-428
oksana-grishchenko Sep 22, 2023
97a1863
troubleshooting
oksana-grishchenko Oct 3, 2023
6aa0c4b
troubleshooting
oksana-grishchenko Oct 3, 2023
5872e87
troubleshooting
oksana-grishchenko Oct 3, 2023
e1b07f0
troubleshooting
oksana-grishchenko Oct 3, 2023
5d841eb
troubleshooting
oksana-grishchenko Oct 4, 2023
8d9605f
troubleshooting
oksana-grishchenko Oct 4, 2023
f6f56ad
Bump docker/metadata-action from 4 to 5 (#197)
dependabot[bot] Sep 25, 2023
8e8cb8f
Bump docker/login-action from 2 to 3 (#196)
dependabot[bot] Sep 25, 2023
7488ca6
Bump docker/build-push-action from 4 to 5 (#195)
dependabot[bot] Sep 25, 2023
b88e9d6
Bump golang.org/x/tools from 0.12.0 to 0.13.0 in /tools (#194)
dependabot[bot] Sep 25, 2023
2879968
Bump github.com/golangci/golangci-lint from 1.54.1 to 1.54.2 in /tool…
dependabot[bot] Sep 25, 2023
0edc91e
Bump github.com/daixiang0/gci from 0.11.0 to 0.11.2 in /tools (#190)
dependabot[bot] Sep 25, 2023
cb2ea75
Bump github.com/aws/aws-sdk-go from 1.45.14 to 1.45.15 (#189)
dependabot[bot] Sep 25, 2023
49dad98
Bump k8s.io/cli-runtime from 0.28.0 to 0.28.2 (#186)
dependabot[bot] Sep 25, 2023
6099414
Bump github.com/vektra/mockery/v2 from 2.33.0 to 2.34.0 in /tools (#192)
dependabot[bot] Sep 25, 2023
50f8b6d
Bump github.com/deepmap/oapi-codegen from 1.13.4 to 1.15.0 in /tools …
dependabot[bot] Sep 25, 2023
2b67112
Bump github.com/percona/everest-operator from 0.0.21 to 0.3.0 (#188)
dependabot[bot] Sep 25, 2023
b565897
Bump @playwright/test from 1.38.0 to 1.38.1 in /api-tests (#183)
dependabot[bot] Sep 25, 2023
e88deb5
Bump eslint from 8.49.0 to 8.50.0 in /api-tests (#184)
dependabot[bot] Sep 25, 2023
22431df
Bump @typescript-eslint/parser from 6.7.0 to 6.7.2 in /api-tests (#185)
dependabot[bot] Sep 25, 2023
0b78b83
Bump sigs.k8s.io/controller-runtime from 0.15.1 to 0.16.2 (#187)
dependabot[bot] Sep 26, 2023
116c7b5
EVEREST-457 Fixed backup deletion (#198)
gen1us2k Sep 26, 2023
587dc32
EVEREST-462 Scan dev-latest for CVEs (#199)
gen1us2k Sep 26, 2023
d311c6e
EVEREST-429 release pipeline (#200)
oksana-grishchenko Sep 27, 2023
aa54653
EVEREST-403 return the default storage class first (#201)
gen1us2k Sep 28, 2023
c6fcfe9
fix monitoring & backup storages
oksana-grishchenko Oct 2, 2023
84e3376
Bump github.com/aws/aws-sdk-go from 1.45.15 to 1.45.19 (#205)
dependabot[bot] Oct 2, 2023
13e0222
Bump @typescript-eslint/parser from 6.7.2 to 6.7.3 in /api-tests (#206)
dependabot[bot] Oct 2, 2023
31b44e0
delete monitoring test update
oksana-grishchenko Oct 3, 2023
4ce312c
restores timeout
oksana-grishchenko Oct 3, 2023
99cf556
psmdb timeout
oksana-grishchenko Oct 3, 2023
b3ccb50
Revert "psmdb timeout"
oksana-grishchenko Oct 3, 2023
f60c5c0
update get monitoring test
oksana-grishchenko Oct 3, 2023
451b7a3
restores tests timeout
oksana-grishchenko Oct 3, 2023
0baa869
Revert "restores tests timeout"
oksana-grishchenko Oct 3, 2023
c3bf763
troubleshooting
oksana-grishchenko Oct 3, 2023
f3ba015
troubleshooting
oksana-grishchenko Oct 3, 2023
9d64791
troubleshooting
oksana-grishchenko Oct 3, 2023
03cf1ce
troubleshooting
oksana-grishchenko Oct 3, 2023
55f1f1f
troubleshooting
oksana-grishchenko Oct 4, 2023
a6763bf
troubleshooting
oksana-grishchenko Oct 4, 2023
4ff7e75
random cluster names
oksana-grishchenko Oct 4, 2023
6a9cf68
Merge remote-tracking branch 'origin/e2e-in-ci' into e2e-in-ci
oksana-grishchenko Oct 4, 2023
d6e7a33
random cluster names
oksana-grishchenko Oct 4, 2023
2e7f6b8
random cluster names
oksana-grishchenko Oct 4, 2023
be876d8
random cluster names
oksana-grishchenko Oct 4, 2023
7170cea
restores fix
oksana-grishchenko Oct 9, 2023
ffd92b3
restores fix
oksana-grishchenko Oct 9, 2023
799a9ff
restores fix
oksana-grishchenko Oct 9, 2023
d2315a9
longer random
oksana-grishchenko Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions api-tests/tests/database-cluster-restores.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,43 @@ test('create/update/delete database cluster restore', async ({request, page}) =>
})

expect(response.ok()).toBeTruthy()
const restore = await response.json()
let restore = await response.json()

expect(restore.spec).toMatchObject(payloadRestore.spec)
await page.waitForTimeout(2000)

response = await request.get(`/v1/kubernetes/${kubernetesId}/database-cluster-restores/${restoreName}`)
expect(response.ok()).toBeTruthy()

if (! response.ok()) {
console.log("!2")
console.log(await response.json())
}
restore = await response.json()

// update restore
restore.spec.dbClusterName = clName2
response = await request.put(`/v1/kubernetes/${kubernetesId}/database-cluster-restores/${restoreName}`, {
data: restore,
})

if (! response.ok()) {
console.log("!3")
console.log(await response.json())
}
expect(response.ok()).toBeTruthy()
const result = await response.json()
let result = await response.json()

expect(result.spec).toMatchObject(restore.spec)

response = await request.get(`/v1/kubernetes/${kubernetesId}/database-cluster-restores/${restoreName}`)
expect(response.ok()).toBeTruthy()
result = await response.json()

// update restore with not existing dbClusterName
restore.spec.dbClusterName = 'not-existing-cluster'
result.spec.dbClusterName = 'not-existing-cluster'
response = await request.put(`/v1/kubernetes/${kubernetesId}/database-cluster-restores/${restoreName}`, {
data: restore,
data: result,
})
expect(response.status()).toBe(400)
expect(await response.text()).toContain('{"message":"DatabaseCluster \'not-existing-cluster\' is not found"}')
Expand Down
2 changes: 1 addition & 1 deletion api-tests/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {APIRequestContext, expect} from '@playwright/test'

// testPrefix is used to differentiate between several workers
// running this test to avoid conflicts in instance names
const testSuffix = () => `${(Math.random() + 1).toString(36).substring(10)}`
const testSuffix = () => `${(Math.random() + 1).toString(36).substring(8)}`

export const randomName = (prefix = "rnd") => {
return `${prefix}-${testSuffix()}`
Expand Down
30 changes: 17 additions & 13 deletions api-tests/tests/psmdb-clusters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ test('create/edit/delete single node psmdb cluster', async ({ request, page }) =
await request.post(`/v1/kubernetes/${kubernetesId}/database-clusters`, {
data: psmdbPayload,
})
let result
for (let i = 0; i < 15; i++) {
await page.waitForTimeout(1000)

const psmdbCluster = await request.get(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`)

expect(psmdbCluster.ok()).toBeTruthy()

const result = (await psmdbCluster.json())
result = (await psmdbCluster.json())

if (typeof result.status === 'undefined' || typeof result.status.size === 'undefined') {
continue
Expand All @@ -85,23 +86,22 @@ test('create/edit/delete single node psmdb cluster', async ({ request, page }) =
expect(result.spec).toMatchObject(psmdbPayload.spec)
expect(result.status.size).toBe(1)

// psmdbPayload should be overriden because kubernetes adds data into metadata field
// and uses metadata.generation during updation. It returns 422 HTTP status code if this field is not present
//
// kubectl under the hood merges everything hence the UX is seemless
psmdbPayload.spec = result.spec
psmdbPayload.metadata = result.metadata
break
}

psmdbPayload.metadata.resourceVersion = result.metadata.resourceVersion
psmdbPayload.spec.engine.config = 'operationProfiling:\nmode: slowOp'

// Update PSMDB cluster

const updatedPSMDBCluster = await request.put(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`, {
data: psmdbPayload,
})

if (! updatedPSMDBCluster.ok()) {
console.log("!3")
console.log(await updatedPSMDBCluster.json())
}

expect(updatedPSMDBCluster.ok()).toBeTruthy()

let psmdbCluster = await request.get(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`)
Expand Down Expand Up @@ -151,14 +151,15 @@ test('expose psmdb cluster after creation', async ({ request, page }) => {
data: psmdbPayload,
})

let result
for (let i = 0; i < 15; i++) {
await page.waitForTimeout(1000)

const psmdbCluster = await request.get(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`)

expect(psmdbCluster.ok()).toBeTruthy()

const result = (await psmdbCluster.json())
result = (await psmdbCluster.json())

if (typeof result.status === 'undefined' || typeof result.status.size === 'undefined') {
continue
Expand All @@ -167,12 +168,10 @@ test('expose psmdb cluster after creation', async ({ request, page }) => {
expect(result.metadata.name).toBe(clusterName)
expect(result.spec).toMatchObject(psmdbPayload.spec)
expect(result.status.size).toBe(3)

psmdbPayload.spec = result.spec
psmdbPayload.metadata = result.metadata
break
}

psmdbPayload.metadata.resourceVersion = result.metadata.resourceVersion
psmdbPayload.spec.proxy.expose.type = 'external'

// Update PSMDB cluster
Expand All @@ -181,6 +180,11 @@ test('expose psmdb cluster after creation', async ({ request, page }) => {
data: psmdbPayload,
})

if (! updatedPSMDBCluster.ok()) {
console.log("!1")
console.log(await updatedPSMDBCluster.json())
}

expect(updatedPSMDBCluster.ok()).toBeTruthy()

let psmdbCluster = await request.get(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`)
Expand Down Expand Up @@ -230,7 +234,7 @@ test('expose psmdb cluster on EKS to the public internet and scale up', async ({
data: psmdbPayload,
})
for (let i = 0; i < 15; i++) {
await page.waitForTimeout(2000)
await page.waitForTimeout(3000)

const psmdbCluster = await request.get(`/v1/kubernetes/${kubernetesId}/database-clusters/${clusterName}`)

Expand Down
Loading