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
24 changes: 8 additions & 16 deletions api-tests/tests/backup-storages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// 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 name = th.randomName()
const payload = {
type: 's3',
name: 'backup-storage-1',
name: name,
url: 'http://custom-url',
description: 'Dev storage',
bucketName: 'percona-test-backup-storage',
Expand All @@ -37,8 +37,6 @@ test('add/list/get/delete backup storage success', async ({ request }) => {
expect(response.ok()).toBeTruthy()
const created = await response.json()

const name = created.name

expect(created.name).toBe(payload.name)
expect(created.url).toBe(payload.url)
expect(created.bucketName).toBe(payload.bucketName)
Expand Down Expand Up @@ -88,13 +86,10 @@ test('add/list/get/delete backup storage success', async ({ request }) => {

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

expect(deleted.ok()).toBeTruthy()
})

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

const testCases = [
{
payload: {},
Expand Down Expand Up @@ -157,10 +152,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 +166,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 +193,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 +205,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
Loading
Loading