diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index 4aa06f4cd9ad7..5110a6b6b3ab9 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -42,6 +42,7 @@ export default function ({ getService, getPageObjects }) { describe('scripted fields', function () { this.tags(['skipFirefox']); + this.onlyEsVersion('<=7'); before(async function () { await browser.setWindowSize(1200, 800); diff --git a/x-pack/test/accessibility/apps/upgrade_assistant.ts b/x-pack/test/accessibility/apps/upgrade_assistant.ts index 9ac9015bf20b4..1e9cc600ea8a1 100644 --- a/x-pack/test/accessibility/apps/upgrade_assistant.ts +++ b/x-pack/test/accessibility/apps/upgrade_assistant.ts @@ -52,7 +52,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const es = getService('es'); const log = getService('log'); - describe('Upgrade Assistant', () => { + describe('Upgrade Assistant', function () { + this.onlyEsVersion('<=7'); + before(async () => { await PageObjects.upgradeAssistant.navigateToPage(); diff --git a/x-pack/test/api_integration/apis/lens/existing_fields.ts b/x-pack/test/api_integration/apis/lens/existing_fields.ts index ab3f6e30afa24..9a856d2bdd454 100644 --- a/x-pack/test/api_integration/apis/lens/existing_fields.ts +++ b/x-pack/test/api_integration/apis/lens/existing_fields.ts @@ -161,6 +161,11 @@ const metricBeatData = [ export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); + const esVersion = getService('esVersion'); + + function fieldFilter(fieldName: string) { + return esVersion.matchRange('>=8') ? fieldName !== '_type' : true; + } describe('existing_fields apis', () => { before(async () => { @@ -189,7 +194,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); expect(body.indexPatternTitle).to.eql('logstash-*'); - expect(body.existingFieldNames.sort()).to.eql(fieldsWithData.sort()); + expect(body.existingFieldNames.sort()).to.eql(fieldsWithData.sort().filter(fieldFilter)); }); it('should succeed for thousands of fields', async () => { @@ -204,7 +209,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); expect(body.indexPatternTitle).to.eql('metricbeat-*'); - expect(body.existingFieldNames.sort()).to.eql(metricBeatData.sort()); + expect(body.existingFieldNames.sort()).to.eql(metricBeatData.sort().filter(fieldFilter)); }); it('should return fields filtered by query and filters', async () => { @@ -243,7 +248,7 @@ export default ({ getService }: FtrProviderContext) => { 'utc_time', 'xss', 'xss.raw', - ]; + ].filter(fieldFilter); const { body } = await supertest .post(`/api/lens/existing_fields/${encodeURIComponent('logstash-*')}`) diff --git a/x-pack/test/api_integration/apis/management/index_lifecycle_management/policies.js b/x-pack/test/api_integration/apis/management/index_lifecycle_management/policies.js index 8e29604a0bf62..837cd236d028b 100644 --- a/x-pack/test/api_integration/apis/management/index_lifecycle_management/policies.js +++ b/x-pack/test/api_integration/apis/management/index_lifecycle_management/policies.js @@ -32,7 +32,9 @@ export default function ({ getService }) { const { addPolicyToIndex } = registerIndexHelpers({ supertest }); - describe('policies', () => { + describe('policies', function () { + this.onlyEsVersion('<=7'); + after(() => Promise.all([cleanUpEsResources(), cleanUpPolicies()])); describe('list', () => { diff --git a/x-pack/test/api_integration/apis/management/index_management/indices.js b/x-pack/test/api_integration/apis/management/index_management/indices.js index 589887329fcd1..34d9cf9498a04 100644 --- a/x-pack/test/api_integration/apis/management/index_management/indices.js +++ b/x-pack/test/api_integration/apis/management/index_management/indices.js @@ -34,7 +34,9 @@ export default function ({ getService }) { clearCache, } = registerHelpers({ supertest }); - describe('indices', () => { + describe('indices', function () { + this.onlyEsVersion('<=7'); + after(() => Promise.all([cleanUpEsResources()])); describe('clear cache', () => { diff --git a/x-pack/test/api_integration/apis/management/index_management/mapping.js b/x-pack/test/api_integration/apis/management/index_management/mapping.js index 0ddb6ab303bbb..a03f9273f5699 100644 --- a/x-pack/test/api_integration/apis/management/index_management/mapping.js +++ b/x-pack/test/api_integration/apis/management/index_management/mapping.js @@ -17,7 +17,9 @@ export default function ({ getService }) { const { getIndexMapping } = registerHelpers({ supertest }); - describe('mapping', () => { + describe('mapping', function () { + this.onlyEsVersion('<=7'); + after(() => Promise.all([cleanUpEsResources()])); it('should fetch the index mapping', async () => { diff --git a/x-pack/test/api_integration/apis/management/index_management/settings.js b/x-pack/test/api_integration/apis/management/index_management/settings.js index 6b48c864458c4..e5d933fc7bf60 100644 --- a/x-pack/test/api_integration/apis/management/index_management/settings.js +++ b/x-pack/test/api_integration/apis/management/index_management/settings.js @@ -17,7 +17,9 @@ export default function ({ getService }) { const { getIndexSettings, updateIndexSettings } = registerHelpers({ supertest }); - describe('settings', () => { + describe('settings', function () { + this.onlyEsVersion('<=7'); + after(() => Promise.all([cleanUpEsResources()])); it('should fetch an index settings', async () => { 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 1cb58c0957e17..3b3c81fbfe56b 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 @@ -25,7 +25,9 @@ export default function ({ getService }) { cleanUpTemplates, } = registerHelpers({ supertest }); - describe('index templates', () => { + describe('index templates', function () { + this.onlyEsVersion('<=7'); + after(() => Promise.all([cleanUpEsResources(), cleanUpTemplates()])); describe('get all', () => { diff --git a/x-pack/test/api_integration/apis/management/rollup/rollup.js b/x-pack/test/api_integration/apis/management/rollup/rollup.js index 69c8ddfcc4197..b3ab67b5563d7 100644 --- a/x-pack/test/api_integration/apis/management/rollup/rollup.js +++ b/x-pack/test/api_integration/apis/management/rollup/rollup.js @@ -24,7 +24,9 @@ export default function ({ getService }) { cleanUp, } = registerHelpers(getService); - describe('jobs', () => { + describe('jobs', function () { + this.onlyEsVersion('<=7'); + after(() => cleanUp()); describe('indices', () => { diff --git a/x-pack/test/api_integration/apis/search/search.ts b/x-pack/test/api_integration/apis/search/search.ts index 45e8933bf715f..a7109c5ddcf4c 100644 --- a/x-pack/test/api_integration/apis/search/search.ts +++ b/x-pack/test/api_integration/apis/search/search.ts @@ -13,7 +13,9 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - describe('search', () => { + describe('search', function () { + this.onlyEsVersion('<=7'); + // https://github.com/elastic/kibana/issues/113082 describe.skip('post', () => { it('should return 200 with final response if wait_for_completion_timeout is long enough', async () => { diff --git a/x-pack/test/api_integration/apis/security_solution/timeline_details.ts b/x-pack/test/api_integration/apis/security_solution/timeline_details.ts index 49124bca42ffe..9d2ff8bd5c0a1 100644 --- a/x-pack/test/api_integration/apis/security_solution/timeline_details.ts +++ b/x-pack/test/api_integration/apis/security_solution/timeline_details.ts @@ -682,6 +682,7 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); const bsearch = getService('bsearch'); + const esVersion = getService('esVersion'); describe('Timeline Details', () => { before( @@ -703,7 +704,12 @@ export default function ({ getService }: FtrProviderContext) { }, strategy: 'timelineSearchStrategy', }); - expect(sortBy(detailsData, 'field')).to.eql(sortBy(EXPECTED_DATA, 'field')); + + const expectedData = esVersion.matchRange('>=8') + ? sortBy(EXPECTED_DATA, 'field').filter((f) => f.field !== '_type') + : sortBy(EXPECTED_DATA, 'field'); + + expect(sortBy(detailsData, 'field')).to.eql(expectedData); }); it('Make sure that we get kpi data', async () => { diff --git a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts index 4d92d2e2c76df..3f79e02be3f5f 100644 --- a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts +++ b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts @@ -8,7 +8,9 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { - describe('Upgrade Assistant', () => { + describe('Upgrade Assistant', function () { + this.onlyEsVersion('<=7'); + loadTestFile(require.resolve('./upgrade_assistant')); loadTestFile(require.resolve('./cloud_backup_status')); loadTestFile(require.resolve('./privileges')); diff --git a/x-pack/test/functional/apps/api_keys/home_page.ts b/x-pack/test/functional/apps/api_keys/home_page.ts index 5907247527585..f90b65c11f0f3 100644 --- a/x-pack/test/functional/apps/api_keys/home_page.ts +++ b/x-pack/test/functional/apps/api_keys/home_page.ts @@ -17,6 +17,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const browser = getService('browser'); describe('Home page', function () { + this.onlyEsVersion('<=7'); + before(async () => { await security.testUser.setRoles(['kibana_admin']); await pageObjects.common.navigateToApp('apiKeys'); diff --git a/x-pack/test/functional/apps/discover/reporting.ts b/x-pack/test/functional/apps/discover/reporting.ts index 01a8bf22677e5..96eb1b96ac4a2 100644 --- a/x-pack/test/functional/apps/discover/reporting.ts +++ b/x-pack/test/functional/apps/discover/reporting.ts @@ -36,7 +36,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return res; }; - describe('Discover CSV Export', () => { + describe('Discover CSV Export', function () { + this.onlyEsVersion('<=7'); + before('initialize tests', async () => { log.debug('ReportingPage:initTests'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); diff --git a/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts b/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts index 4c41abc745d8e..09329b0cbe2b4 100644 --- a/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts +++ b/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts @@ -15,7 +15,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const appsMenu = getService('appsMenu'); const managementMenu = getService('managementMenu'); - describe('security', () => { + describe('security', function () { + this.onlyEsVersion('<=7'); + before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); await PageObjects.common.navigateToApp('home'); 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 3b0e220f35231..1f69e4d2ffdc3 100644 --- a/x-pack/test/functional/apps/index_management/home_page.ts +++ b/x-pack/test/functional/apps/index_management/home_page.ts @@ -17,6 +17,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const security = getService('security'); describe('Home page', function () { + this.onlyEsVersion('<=7'); + before(async () => { await security.testUser.setRoles(['index_management_user']); await pageObjects.common.navigateToApp('indexManagement'); diff --git a/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts b/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts index 3737d61f76b20..2310c45e7f4ff 100644 --- a/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts +++ b/x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts @@ -22,6 +22,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { describe('Ingest Pipelines', function () { this.tags('smoke'); + this.onlyEsVersion('<=7'); + before(async () => { await security.testUser.setRoles(['ingest_pipelines_user']); await pageObjects.common.navigateToApp('ingestPipelines'); diff --git a/x-pack/test/functional/apps/security/users.ts b/x-pack/test/functional/apps/security/users.ts index 2f7f2e0aaabde..be52416facd91 100644 --- a/x-pack/test/functional/apps/security/users.ts +++ b/x-pack/test/functional/apps/security/users.ts @@ -24,6 +24,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { } describe('users', function () { + this.onlyEsVersion('<=7'); + const optionalUser: UserFormValues = { username: 'OptionalUser', password: 'OptionalUserPwd', diff --git a/x-pack/test/functional/apps/upgrade_assistant/index.ts b/x-pack/test/functional/apps/upgrade_assistant/index.ts index d1ab46463e930..825b5a177c201 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/index.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/index.ts @@ -10,6 +10,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function upgradeCheckup({ loadTestFile }: FtrProviderContext) { describe('Upgrade Assistant', function upgradeAssistantTestSuite() { this.tags('ciGroup4'); + this.onlyEsVersion('<=7'); loadTestFile(require.resolve('./feature_controls')); loadTestFile(require.resolve('./deprecation_pages')); diff --git a/x-pack/test/functional/apps/upgrade_assistant/overview_page.ts b/x-pack/test/functional/apps/upgrade_assistant/overview_page.ts index a26811cfd0b85..71c32dc4283b8 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/overview_page.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/overview_page.ts @@ -18,6 +18,7 @@ export default function upgradeAssistantOverviewPageFunctionalTests({ describe('Overview Page', function () { this.tags('skipFirefox'); + this.onlyEsVersion('<=7'); before(async () => { await security.testUser.setRoles(['superuser']); diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts b/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts index 3515602342db5..6d51bd662645c 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/download_csv_dashboard.ts @@ -36,7 +36,9 @@ export default function ({ getService }: FtrProviderContext) { const fromTime = '2019-06-20T00:00:00.000Z'; const toTime = '2019-06-25T00:00:00.000Z'; - describe('CSV Generation from SearchSource', () => { + describe('CSV Generation from SearchSource', function () { + this.onlyEsVersion('<=7'); + before(async () => { await kibanaServer.uiSettings.update({ 'csv:quoteValues': false, diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/generate_csv_discover.ts b/x-pack/test/reporting_api_integration/reporting_and_security/generate_csv_discover.ts index e16c9063aa497..6ad7fce240da5 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/generate_csv_discover.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/generate_csv_discover.ts @@ -14,7 +14,9 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const reportingAPI = getService('reportingAPI'); - describe('Generate CSV from SearchSource', () => { + describe('Generate CSV from SearchSource', function () { + this.onlyEsVersion('<=7'); + it(`exported CSV file matches snapshot`, async () => { await reportingAPI.initEcommerce(); diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts b/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts index 994523ce78eff..04e9ceedfc490 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/ilm_migration_apis.ts @@ -20,7 +20,9 @@ export default function ({ getService }: FtrProviderContext) { const reportingAPI = getService('reportingAPI'); const security = getService('security'); - describe('ILM policy migration APIs', () => { + describe('ILM policy migration APIs', function () { + this.onlyEsVersion('<=7'); + before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/reporting/logs'); await esArchiver.load('x-pack/test/functional/es_archives/logstash_functional'); diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/search_frozen_indices.ts b/x-pack/test/reporting_api_integration/reporting_and_security/search_frozen_indices.ts index daa749649e250..8441e8bb8bb8f 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/search_frozen_indices.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/search_frozen_indices.ts @@ -47,7 +47,9 @@ export default function ({ getService }: FtrProviderContext) { .send(job); } - describe('Frozen indices search', () => { + describe('Frozen indices search', function () { + this.onlyEsVersion('<=7'); + const reset = async () => { await kibanaServer.uiSettings.replace({ 'search:includeFrozen': false }); try { diff --git a/x-pack/test/security_api_integration/kerberos.config.ts b/x-pack/test/security_api_integration/kerberos.config.ts index a34d1efa3f14e..7dba77e61999e 100644 --- a/x-pack/test/security_api_integration/kerberos.config.ts +++ b/x-pack/test/security_api_integration/kerberos.config.ts @@ -29,6 +29,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xPackAPITestsConfig.get('esTestCluster.serverArgs'), 'xpack.security.authc.token.enabled=true', 'xpack.security.authc.token.timeout=15s', + 'xpack.security.authc.realms.kerberos.kerb1.order=0', `xpack.security.authc.realms.kerberos.kerb1.keytab.path=${kerberosKeytabPath}`, ], diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/package.ts b/x-pack/test/security_solution_endpoint_api_int/apis/package.ts index a8fd5a612b306..db8c034a3b2d8 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/package.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/package.ts @@ -66,7 +66,9 @@ export default function ({ getService }: FtrProviderContext) { }); }; - describe('Endpoint package', () => { + describe('Endpoint package', function () { + this.onlyEsVersion('<=7'); + describe('network processors', () => { let networkIndexData: InsertedEvents; diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js index 1a7090a3cbdfb..453ae5022972a 100644 --- a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js +++ b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js @@ -8,6 +8,7 @@ export default function ({ loadTestFile }) { describe('upgrade assistant', function () { this.tags('ciGroup7'); + this.onlyEsVersion('<=7'); loadTestFile(require.resolve('./reindexing')); });