From 9a0dfcff0488220979fdbac46c080c41c98fb8f8 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Fri, 18 Sep 2020 11:08:10 +0200 Subject: [PATCH] Re-enable session lifespan, idle timeout api integration tests and use unique names for the security test reports. (#77746) --- x-pack/test/api_integration/config_security_basic.ts | 1 + x-pack/test/api_integration/config_security_trial.ts | 1 + x-pack/test/functional/config_security_basic.ts | 2 +- .../test/security_api_integration/session_idle.config.ts | 2 +- .../security_api_integration/session_lifespan.config.ts | 2 +- .../tests/session_idle/cleanup.ts | 8 ++------ .../tests/session_lifespan/cleanup.ts | 8 ++------ x-pack/test/security_functional/login_selector.config.ts | 2 +- x-pack/test/security_functional/oidc.config.ts | 2 +- x-pack/test/security_functional/saml.config.ts | 2 +- 10 files changed, 12 insertions(+), 18 deletions(-) diff --git a/x-pack/test/api_integration/config_security_basic.ts b/x-pack/test/api_integration/config_security_basic.ts index 8489940505686..237d162e80328 100644 --- a/x-pack/test/api_integration/config_security_basic.ts +++ b/x-pack/test/api_integration/config_security_basic.ts @@ -19,6 +19,7 @@ export default async function (context: FtrConfigProviderContext) { 'xpack.security.authc.api_key.enabled=true', ]; config.testFiles = [require.resolve('./apis/security/security_basic')]; + config.junit.reportName = 'X-Pack API Integration Tests (Security Basic)'; return config; }); } diff --git a/x-pack/test/api_integration/config_security_trial.ts b/x-pack/test/api_integration/config_security_trial.ts index 4c1e2913b987c..839165d8618cf 100644 --- a/x-pack/test/api_integration/config_security_trial.ts +++ b/x-pack/test/api_integration/config_security_trial.ts @@ -12,6 +12,7 @@ import { default as createTestConfig } from './config'; export default async function (context: FtrConfigProviderContext) { return createTestConfig(context).then((config) => { config.testFiles = [require.resolve('./apis/security/security_trial')]; + config.junit.reportName = 'X-Pack API Integration Tests (Security Trial)'; return config; }); } diff --git a/x-pack/test/functional/config_security_basic.ts b/x-pack/test/functional/config_security_basic.ts index 48c397d9c37de..968281b75b7ac 100644 --- a/x-pack/test/functional/config_security_basic.ts +++ b/x-pack/test/functional/config_security_basic.ts @@ -70,7 +70,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, junit: { - reportName: 'Chrome X-Pack UI Functional Tests', + reportName: 'Chrome X-Pack UI Functional Tests (Security Basic)', }, }; } diff --git a/x-pack/test/security_api_integration/session_idle.config.ts b/x-pack/test/security_api_integration/session_idle.config.ts index da85c6342037e..34a23b7f5f926 100644 --- a/x-pack/test/security_api_integration/session_idle.config.ts +++ b/x-pack/test/security_api_integration/session_idle.config.ts @@ -36,7 +36,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, junit: { - reportName: 'X-Pack Security API Integration Tests', + reportName: 'X-Pack Security API Integration Tests (Session Idle Timeout)', }, }; } diff --git a/x-pack/test/security_api_integration/session_lifespan.config.ts b/x-pack/test/security_api_integration/session_lifespan.config.ts index 17773a7739847..b5fdf6b6914b1 100644 --- a/x-pack/test/security_api_integration/session_lifespan.config.ts +++ b/x-pack/test/security_api_integration/session_lifespan.config.ts @@ -36,7 +36,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, junit: { - reportName: 'X-Pack Security API Integration Tests', + reportName: 'X-Pack Security API Integration Tests (Session Lifespan)', }, }; } diff --git a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts index f288bc925123e..01e2ad76fb3d2 100644 --- a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts @@ -33,15 +33,11 @@ export default function ({ getService }: FtrProviderContext) { return (await es.search({ index: '.kibana_security_session*' })).hits.total.value; } - // FLAKY: https://github.com/elastic/kibana/issues/76239 - describe.skip('Session Idle cleanup', () => { + describe('Session Idle cleanup', () => { beforeEach(async () => { await es.cluster.health({ index: '.kibana_security_session*', waitForStatus: 'green' }); - await es.deleteByQuery({ + await es.indices.delete({ index: '.kibana_security_session*', - q: '*', - waitForCompletion: true, - refresh: true, ignore: [404], }); }); diff --git a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts index dbdaf494fdf27..6036acf3d1cf1 100644 --- a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts @@ -30,15 +30,11 @@ export default function ({ getService }: FtrProviderContext) { return (await es.search({ index: '.kibana_security_session*' })).hits.total.value; } - // FLAKY: https://github.com/elastic/kibana/issues/76223 - describe.skip('Session Lifespan cleanup', () => { + describe('Session Lifespan cleanup', () => { beforeEach(async () => { await es.cluster.health({ index: '.kibana_security_session*', waitForStatus: 'green' }); - await es.deleteByQuery({ + await es.indices.delete({ index: '.kibana_security_session*', - q: '*', - waitForCompletion: true, - refresh: true, ignore: [404], }); }); diff --git a/x-pack/test/security_functional/login_selector.config.ts b/x-pack/test/security_functional/login_selector.config.ts index 48665c93c091a..bdb4778740503 100644 --- a/x-pack/test/security_functional/login_selector.config.ts +++ b/x-pack/test/security_functional/login_selector.config.ts @@ -76,7 +76,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { screenshots: { directory: resolve(__dirname, 'screenshots') }, junit: { - reportName: 'Chrome X-Pack Security Functional Tests', + reportName: 'Chrome X-Pack Security Functional Tests (Login Selector)', }, }; } diff --git a/x-pack/test/security_functional/oidc.config.ts b/x-pack/test/security_functional/oidc.config.ts index 5fd59e049a0f4..1ed5d51098420 100644 --- a/x-pack/test/security_functional/oidc.config.ts +++ b/x-pack/test/security_functional/oidc.config.ts @@ -76,7 +76,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { screenshots: { directory: resolve(__dirname, 'screenshots') }, junit: { - reportName: 'Chrome X-Pack Security Functional Tests', + reportName: 'Chrome X-Pack Security Functional Tests (OpenID Connect)', }, }; } diff --git a/x-pack/test/security_functional/saml.config.ts b/x-pack/test/security_functional/saml.config.ts index c47145f8bc039..9d925bee480a8 100644 --- a/x-pack/test/security_functional/saml.config.ts +++ b/x-pack/test/security_functional/saml.config.ts @@ -70,7 +70,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { screenshots: { directory: resolve(__dirname, 'screenshots') }, junit: { - reportName: 'Chrome X-Pack Security Functional Tests', + reportName: 'Chrome X-Pack Security Functional Tests (SAML)', }, }; }