From 9f2d9d4d54ad89f3c6dee85d79af0e323633e0d5 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Fri, 16 Jul 2021 16:19:30 +0200 Subject: [PATCH] Fixes "servers.elasticsearch.auth" must be a string error (#105095) * fixes integration with stack testing upgrade framework * fixes the provider name flexibility * fixes type check error Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/security_solution/cypress/tasks/login.ts | 7 ++++++- x-pack/test/security_solution_cypress/upgrade_config.ts | 7 +------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/tasks/login.ts b/x-pack/plugins/security_solution/cypress/tasks/login.ts index 243bfd113bfd2..2eba6aba0c5e2 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/login.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/login.ts @@ -205,6 +205,11 @@ const credentialsProvidedByEnvironment = (): boolean => * Kibana's `/internal/security/login` endpoint, bypassing the login page (for speed). */ const loginViaEnvironmentCredentials = () => { + const providerName = + Cypress.env('protocol') === 'http' || Cypress.config().baseUrl!.includes('staging') + ? 'basic' + : 'cloud-basic'; + cy.log( `Authenticating via environment credentials from the \`CYPRESS_${ELASTICSEARCH_USERNAME}\` and \`CYPRESS_${ELASTICSEARCH_PASSWORD}\` environment variables` ); @@ -213,7 +218,7 @@ const loginViaEnvironmentCredentials = () => { cy.request({ body: { providerType: 'basic', - providerName: 'basic', + providerName, currentURL: '/', params: { username: Cypress.env(ELASTICSEARCH_USERNAME), diff --git a/x-pack/test/security_solution_cypress/upgrade_config.ts b/x-pack/test/security_solution_cypress/upgrade_config.ts index a17d0ef00397c..95aa58489851b 100644 --- a/x-pack/test/security_solution_cypress/upgrade_config.ts +++ b/x-pack/test/security_solution_cypress/upgrade_config.ts @@ -5,15 +5,10 @@ * 2.0. */ -import { FtrConfigProviderContext } from '@kbn/test'; - import { SecuritySolutionCypressUpgradeCliTestRunner } from './runner'; -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const securitySolutionCypressConfig = await readConfigFile(require.resolve('./config.ts')); +export default async function () { return { - ...securitySolutionCypressConfig.getAll(), - testRunner: SecuritySolutionCypressUpgradeCliTestRunner, }; }