diff --git a/api-tests/tests/helpers.ts b/api-tests/tests/helpers.ts index 40bf1c18..50b63ab0 100644 --- a/api-tests/tests/helpers.ts +++ b/api-tests/tests/helpers.ts @@ -2,10 +2,10 @@ import { expect, test } from '@playwright/test' // testPrefix is used to differentiate between several workers // running this test to avoid conflicts in instance names -export const testPrefix = () => `t${(Math.random() + 1).toString(36).substring(10)}` +export const testPrefix = `t${(Math.random() + 1).toString(36).substring(10)}` export const suffixedName = (name) => { - return `${name}-${testPrefix()}` + return `${name}-${testPrefix}` } export const checkError = async response => { diff --git a/api-tests/tests/kubernetes.spec.ts b/api-tests/tests/kubernetes.spec.ts index bdb2dfb6..3cc217c8 100644 --- a/api-tests/tests/kubernetes.spec.ts +++ b/api-tests/tests/kubernetes.spec.ts @@ -31,38 +31,6 @@ test('get resource usage', async ({ request }) => { expect(resources?.available).toBeTruthy() }) -test('enable/disable cluster-monitoring', async ({ request }) => { - const data = { - type: 'pmm', - name: `${testPrefix}-monit`, - url: 'http://monitoring', - targetNamespaces: [testsNs], - pmm: { - apiKey: '123', - }, - } - - const response = await request.post('/v1/monitoring-instances', { data }) - - await checkError(response) - const created = await response.json() - - const rEnable = await request.post(`/v1/cluster-monitoring`, { - data: { - enable: true, - monitoringInstanceName: created.name, - }, - }) - - await checkError(rEnable) - - const rDisable = await request.post(`/v1/cluster-monitoring`, { - data: { enable: false }, - }) - - await checkError(rDisable) -}) - test('get cluster info', async ({ request }) => { const r = await request.get(`/v1/cluster-info`) const info = await r.json() diff --git a/api-tests/tests/monitoring-instances.spec.ts b/api-tests/tests/monitoring-instances.spec.ts index 16c471d3..00adde3a 100644 --- a/api-tests/tests/monitoring-instances.spec.ts +++ b/api-tests/tests/monitoring-instances.spec.ts @@ -131,7 +131,7 @@ test('get monitoring instance', async ({ request }) => { }) test('delete monitoring instance', async ({ request }) => { - const namePrefix = 'delete-' + const namePrefix = 'del-' const names = await createInstances(request, namePrefix) const name = names[1]