From d63872b97c8c188ba03fe318c011860a6c1727c3 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Jul 2020 16:07:27 -0700 Subject: [PATCH 1/6] Make Index Management functional and API integration tests robust against side effects introduced by Ingest Manager. --- .../apis/management/index_management/templates.js | 5 +++-- x-pack/test/functional/apps/index_management/home_page.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/test/api_integration/apis/management/index_management/templates.js b/x-pack/test/api_integration/apis/management/index_management/templates.js index cd7f5fb209eca..c11287f59a2ea 100644 --- a/x-pack/test/api_integration/apis/management/index_management/templates.js +++ b/x-pack/test/api_integration/apis/management/index_management/templates.js @@ -40,8 +40,9 @@ export default function ({ getService }) { it('should list all the index templates with the expected parameters', async () => { const { body: allTemplates } = await getAllTemplates().expect(200); - // Composable templates - expect(allTemplates.templates).to.eql([]); + // Composable templates may have been created by other apps, e.g. Ingest Manager, + // so we don't make any assertion about these contents. + expect(Array.isArray(allTemplates.templates)).to.eql(true); // Legacy templates const legacyTemplate = allTemplates.legacyTemplates.find( diff --git a/x-pack/test/functional/apps/index_management/home_page.ts b/x-pack/test/functional/apps/index_management/home_page.ts index 90bc3603c1613..eab90e1fc19cf 100644 --- a/x-pack/test/functional/apps/index_management/home_page.ts +++ b/x-pack/test/functional/apps/index_management/home_page.ts @@ -81,9 +81,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const url = await browser.getCurrentUrl(); expect(url).to.contain(`/component_templates`); - // There should be no component templates by default, so we verify the empty prompt displays - const componentTemplateEmptyPrompt = await testSubjects.exists('emptyList'); - expect(componentTemplateEmptyPrompt).to.be(true); + // Verify content. Component templates may have been created by other apps, e.g. Ingest Manager, + // so we don't make any assertion about the presence or absence of component templates. + const componentTemplateList = await testSubjects.exists('componentTemplateList'); + expect(componentTemplateList).to.be(true); }); }); }); From 769d55d9ab472f78518efca92c6027b3b847b41e Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Jul 2020 16:10:05 -0700 Subject: [PATCH 2/6] Fix wording. --- .../apis/management/index_management/templates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/management/index_management/templates.js b/x-pack/test/api_integration/apis/management/index_management/templates.js index c11287f59a2ea..cafaa78e8e075 100644 --- a/x-pack/test/api_integration/apis/management/index_management/templates.js +++ b/x-pack/test/api_integration/apis/management/index_management/templates.js @@ -40,7 +40,7 @@ export default function ({ getService }) { it('should list all the index templates with the expected parameters', async () => { const { body: allTemplates } = await getAllTemplates().expect(200); - // Composable templates may have been created by other apps, e.g. Ingest Manager, + // Composable index templates may have been created by other apps, e.g. Ingest Manager, // so we don't make any assertion about these contents. expect(Array.isArray(allTemplates.templates)).to.eql(true); From 0f19f12207728f5ba451bf16edcd6e9b82f47679 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Jul 2020 16:13:35 -0700 Subject: [PATCH 3/6] Unskip tests. --- .../apis/management/index_management/templates.js | 3 +-- x-pack/test/functional/apps/index_management/home_page.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/test/api_integration/apis/management/index_management/templates.js b/x-pack/test/api_integration/apis/management/index_management/templates.js index dd760645417d8..cafaa78e8e075 100644 --- a/x-pack/test/api_integration/apis/management/index_management/templates.js +++ b/x-pack/test/api_integration/apis/management/index_management/templates.js @@ -24,8 +24,7 @@ export default function ({ getService }) { updateTemplate, } = registerHelpers({ supertest }); - // blocking es snapshot promotion: https://github.com/elastic/kibana/issues/70532 - describe.skip('index templates', () => { + describe('index templates', () => { after(() => Promise.all([cleanUpEsResources()])); describe('get all', () => { diff --git a/x-pack/test/functional/apps/index_management/home_page.ts b/x-pack/test/functional/apps/index_management/home_page.ts index e892f946920cc..eab90e1fc19cf 100644 --- a/x-pack/test/functional/apps/index_management/home_page.ts +++ b/x-pack/test/functional/apps/index_management/home_page.ts @@ -13,8 +13,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const log = getService('log'); const browser = getService('browser'); - // blocking es snapshot promotion: https://github.com/elastic/kibana/issues/70532 - describe.skip('Home page', function () { + describe('Home page', function () { before(async () => { await pageObjects.common.navigateToApp('indexManagement'); }); From 6f064c14079f26c7e7eb1b53b94188f92fd7f69b Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Jul 2020 16:14:39 -0700 Subject: [PATCH 4/6] Better error message. --- .../apis/management/index_management/templates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/management/index_management/templates.js b/x-pack/test/api_integration/apis/management/index_management/templates.js index cafaa78e8e075..fcee8ed6a183f 100644 --- a/x-pack/test/api_integration/apis/management/index_management/templates.js +++ b/x-pack/test/api_integration/apis/management/index_management/templates.js @@ -42,7 +42,7 @@ export default function ({ getService }) { // Composable index templates may have been created by other apps, e.g. Ingest Manager, // so we don't make any assertion about these contents. - expect(Array.isArray(allTemplates.templates)).to.eql(true); + expect(allTemplates.templates).to.be.an('array'); // Legacy templates const legacyTemplate = allTemplates.legacyTemplates.find( From fecd11f1431b28ada0bc08bbd26d34f6c24d45ae Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Jul 2020 16:15:56 -0700 Subject: [PATCH 5/6] Temporarily change ES snapshot. --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7869fa68788bd..d4653150d7e05 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,7 @@ #!/bin/groovy +env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 'true' + library 'kibana-pipeline-library' kibanaLibrary.load() From 7e565aa04eed9b009e1c357322cd9ada24559cca Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 2 Jul 2020 08:24:00 -0700 Subject: [PATCH 6/6] Revert "Temporarily change ES snapshot." This reverts commit fecd11f1431b28ada0bc08bbd26d34f6c24d45ae. --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d4653150d7e05..7869fa68788bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,5 @@ #!/bin/groovy -env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 'true' - library 'kibana-pipeline-library' kibanaLibrary.load()