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

EVEREST-478 Flaky tests #207

Closed
wants to merge 12 commits into from
18 changes: 6 additions & 12 deletions api-tests/tests/backup-storages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { expect, test } from '@fixtures'
import * as th from './helpers'

let req

test('add/list/get/delete backup storage success', async ({ request }) => {
req = request
const payload = {
type: 's3',
name: 'backup-storage-1',
Expand Down Expand Up @@ -93,8 +92,6 @@ test('add/list/get/delete backup storage success', async ({ request }) => {
})

test('create backup storage failures', async ({ request }) => {
req = request

const testCases = [
{
payload: {},
Expand Down Expand Up @@ -157,10 +154,10 @@ test('create backup storage failures', async ({ request }) => {
})

test('update backup storage failures', async ({ request }) => {
req = request
const name = th.randomName()
const createPayload = {
type: 's3',
name: 'backup-storage-2',
name: name,
bucketName: 'percona-test-backup-storage',
region: 'us-east-2',
accessKey: 'sdfsdfs',
Expand All @@ -171,9 +168,6 @@ test('update backup storage failures', async ({ request }) => {
})

expect(response.ok()).toBeTruthy()
const created = await response.json()

const name = created.name

const testCases = [
{
Expand Down Expand Up @@ -201,7 +195,7 @@ test('update backup storage failures', async ({ request }) => {
})

test('update: backup storage not found', async ({ request }) => {
const name = 'some-storage'
const name = th.randomName()

const response = await request.patch(`/v1/backup-storages/${name}`, {
data: {
Expand All @@ -213,15 +207,15 @@ test('update: backup storage not found', async ({ request }) => {
})

test('delete: backup storage not found', async ({ request }) => {
const name = 'backup-storage'
const name = th.randomName()

const response = await request.delete(`/v1/backup-storages/${name}`)

expect(response.status()).toBe(404)
})

test('get: backup storage not found', async ({ request }) => {
const name = 'backup-storage'
const name = th.randomName()
const response = await request.get(`/v1/backup-storages/${name}`)

expect(response.status()).toBe(404)
Expand Down
24 changes: 12 additions & 12 deletions api-tests/tests/database-cluster-backups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ test.beforeAll(async ({ request }) => {
})

test('create/delete database cluster backups', async ({ request }) => {
const bsName = th.suffixedName('storage')
const clName = th.suffixedName('cluster')
const bsName = th.randomName('storage')
const clName = th.randomName('cluster')

await th.createBackupStorage(request, bsName)
await th.createDBCluster(request, kubernetesId, clName)

const backupName = th.suffixedName('backup')
const backupName = th.randomName('backup')

const payload = {
apiVersion: 'everest.percona.com/v1alpha1',
Expand Down Expand Up @@ -61,11 +61,11 @@ test('create/delete database cluster backups', async ({ request }) => {
})

test('dbcluster not found', async ({ request }) => {
const bsName = th.suffixedName('storage')
const bsName = th.randomName('storage')

await th.createBackupStorage(request, bsName)

const backupName = th.suffixedName('backup')
const backupName = th.randomName('backup')
const payload = {
apiVersion: 'everest.percona.com/v1alpha1',
kind: 'DatabaseClusterBackup',
Expand All @@ -90,18 +90,18 @@ test('dbcluster not found', async ({ request }) => {
})

test('list backups', async ({ request, page }) => {
const bsName = th.suffixedName('storage')
const clusterName1 = th.suffixedName('cluster1')
const clusterName2 = th.suffixedName('cluster2')
const bsName = th.randomName('storage')
const clusterName1 = th.randomName('cluster1')
const clusterName2 = th.randomName('cluster2')

await th.createBackupStorage(request, bsName)
await th.createDBCluster(request, kubernetesId, clusterName1)
await th.createDBCluster(request, kubernetesId, clusterName2)

const backupName1 = th.suffixedName('backup1')
const backupName2 = th.suffixedName('backup2')
const backupName3 = th.suffixedName('backup3')
const backupName4 = th.suffixedName('backup4')
const backupName1 = th.randomName('backup1')
const backupName2 = th.randomName('backup2')
const backupName3 = th.randomName('backup3')
const backupName4 = th.randomName('backup4')

const payloads = [
{
Expand Down
32 changes: 16 additions & 16 deletions api-tests/tests/database-cluster-restores.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ test.beforeAll(async ({ request }) => {
})

test('create/update/delete database cluster restore', async ({ request }) => {
const bsName = th.suffixedName('storage')
const clName = th.suffixedName('cluster')
const clName2 = th.suffixedName('cluster2')
const backupName = th.suffixedName('backup')
const bsName = th.randomName('storage')
const clName = th.randomName('cluster')
const clName2 = th.randomName('cluster2')
const backupName = th.randomName('backup')

await th.createBackupStorage(request, bsName)
await th.createDBCluster(request, kubernetesId, clName)
await th.createDBCluster(request, kubernetesId, clName2)
await th.createBackup(request, kubernetesId, clName, backupName, bsName)

const restoreName = th.suffixedName('restore')
const restoreName = th.randomName('restore')

const payloadRestore = {
apiVersion: 'everest.percona.com/v1alpha1',
Expand Down Expand Up @@ -90,19 +90,19 @@ test('create/update/delete database cluster restore', async ({ request }) => {
})

test('list restores', async ({ request, page }) => {
const bsName = th.suffixedName('storage')
const clName1 = th.suffixedName('cluster1')
const clName2 = th.suffixedName('cluster2')
const backupName = th.suffixedName('backup')
const bsName = th.randomName('storage')
const clName1 = th.randomName('cluster1')
const clName2 = th.randomName('cluster2')
const backupName = th.randomName('backup')

await th.createBackupStorage(request, bsName)
await th.createDBCluster(request, kubernetesId, clName1)
await th.createDBCluster(request, kubernetesId, clName2)
await th.createBackup(request, kubernetesId, clName1, backupName, bsName)

const restoreName1 = th.suffixedName('restore1')
const restoreName2 = th.suffixedName('restore2')
const restoreName3 = th.suffixedName('restore3')
const restoreName1 = th.randomName('restore1')
const restoreName2 = th.randomName('restore2')
const restoreName3 = th.randomName('restore3')

const payloads = [
{
Expand Down Expand Up @@ -181,16 +181,16 @@ test('list restores', async ({ request, page }) => {
})

test('create restore: validation errors', async ({ request, page }) => {
const bsName = th.suffixedName('storage')
const backupName = th.suffixedName('backup')
const clName = th.suffixedName('cl')
const bsName = th.randomName('storage')
const backupName = th.randomName('backup')
const clName = th.randomName('cl')

await th.createBackupStorage(request, bsName)
await th.createDBCluster(request, kubernetesId, clName)
await th.createBackup(request, kubernetesId, clName, backupName, bsName)

// dbcluster not found
const restoreName = th.suffixedName('restore')
const restoreName = th.randomName('restore')
const payloadRestore = {
apiVersion: 'everest.percona.com/v1alpha1',
kind: 'DatabaseClusterRestore',
Expand Down
Loading
Loading