From 5d475f151151463aabae24567818e416dba44098 Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Mon, 11 Nov 2024 14:42:23 +0100 Subject: [PATCH] Rename supertest --- .../apm/alerts/error_count_threshold.spec.ts | 17 ++++++++++------- .../apm/alerts/transaction_duration.spec.ts | 15 +++++++++------ .../apm/alerts/transaction_error_rate.spec.ts | 15 +++++++++------ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts index 4e3164ebe5970..65a22337349c6 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts @@ -31,7 +31,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon describe('error count threshold alert', () => { let apmSynthtraceEsClient: ApmSynthtraceEsClient; - let supertestWithRoleScope: SupertestWithRoleScopeType; + let supertestViewerWithCookieCredentials: SupertestWithRoleScopeType; let roleAuthc: RoleCredentials; const javaErrorMessage = 'a java error'; @@ -52,12 +52,15 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon }; before(async () => { - supertestWithRoleScope = await roleScopedSupertest.getSupertestWithRoleScope('viewer', { - withInternalHeaders: true, - useCookieHeader: true, - }); + supertestViewerWithCookieCredentials = await roleScopedSupertest.getSupertestWithRoleScope( + 'viewer', + { + withInternalHeaders: true, + useCookieHeader: true, + } + ); - roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); + roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('editor'); const opbeansJava = apm .service({ name: 'opbeans-java', environment: 'production', agentName: 'java' }) @@ -113,7 +116,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(async () => { await apmSynthtraceEsClient.clean(); - await supertestWithRoleScope.destroy(); + await supertestViewerWithCookieCredentials.destroy(); await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); }); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_duration.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_duration.spec.ts index e82168820a90d..0cd3446359557 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_duration.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_duration.spec.ts @@ -43,14 +43,17 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon describe('transaction duration alert', () => { let apmSynthtraceEsClient: ApmSynthtraceEsClient; - let supertest: SupertestWithRoleScopeType; + let supertestViewerWithCookieCredentials: SupertestWithRoleScopeType; let roleAuthc: RoleCredentials; before(async () => { - supertest = await roleScopedSupertest.getSupertestWithRoleScope('viewer', { - withInternalHeaders: true, - useCookieHeader: true, - }); + supertestViewerWithCookieCredentials = await roleScopedSupertest.getSupertestWithRoleScope( + 'viewer', + { + withInternalHeaders: true, + useCookieHeader: true, + } + ); roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); @@ -83,7 +86,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(async () => { await apmSynthtraceEsClient.clean(); - await supertest.destroy(); + await supertestViewerWithCookieCredentials.destroy(); await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); }); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_error_rate.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_error_rate.spec.ts index 538232884f729..e538ff0e6a3ba 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_error_rate.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/transaction_error_rate.spec.ts @@ -31,14 +31,17 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon describe('transaction error rate alert', () => { let apmSynthtraceEsClient: ApmSynthtraceEsClient; - let supertest: SupertestWithRoleScopeType; + let supertestViewerWithCookieCredentials: SupertestWithRoleScopeType; let roleAuthc: RoleCredentials; before(async () => { - supertest = await roleScopedSupertest.getSupertestWithRoleScope('viewer', { - withInternalHeaders: true, - useCookieHeader: true, - }); + supertestViewerWithCookieCredentials = await roleScopedSupertest.getSupertestWithRoleScope( + 'viewer', + { + withInternalHeaders: true, + useCookieHeader: true, + } + ); roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); @@ -81,7 +84,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(async () => { await apmSynthtraceEsClient.clean(); - await supertest.destroy(); + await supertestViewerWithCookieCredentials.destroy(); await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); });