From b08f4c92bb6c9f96c9e63c30c65fe9d1a26b954c Mon Sep 17 00:00:00 2001 From: Jonathan Buttner Date: Fri, 2 Oct 2020 12:37:55 -0400 Subject: [PATCH] Fixing list test and reenabling security functional tests --- .../apis/epm/list.ts | 28 ++++++++----------- .../apps/endpoint/index.ts | 2 +- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/x-pack/test/ingest_manager_api_integration/apis/epm/list.ts b/x-pack/test/ingest_manager_api_integration/apis/epm/list.ts index bfe1954e46c9f9..732696433279f2 100644 --- a/x-pack/test/ingest_manager_api_integration/apis/epm/list.ts +++ b/x-pack/test/ingest_manager_api_integration/apis/epm/list.ts @@ -6,21 +6,23 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; -import { warnAndSkipTest } from '../../helpers'; +import { skipIfNoDockerRegistry } from '../../helpers'; +import { setupIngest } from '../fleet/agents/services'; -export default function ({ getService }: FtrProviderContext) { - const log = getService('log'); +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; const supertest = getService('supertest'); - const dockerServers = getService('dockerServers'); - const server = dockerServers.get('registry'); // use function () {} and not () => {} here // because `this` has to point to the Mocha context // see https://mochajs.org/#arrow-functions describe('EPM - list', async function () { - it('lists all packages from the registry', async function () { - if (server.enabled) { + skipIfNoDockerRegistry(providerContext); + setupIngest(providerContext); + + describe('list api tests', async () => { + it('lists all packages from the registry', async function () { const fetchPackageList = async () => { const response = await supertest .get('/api/ingest_manager/epm/packages') @@ -30,13 +32,9 @@ export default function ({ getService }: FtrProviderContext) { }; const listResponse = await fetchPackageList(); expect(listResponse.response.length).not.to.be(0); - } else { - warnAndSkipTest(this, log); - } - }); + }); - it('lists all limited packages from the registry', async function () { - if (server.enabled) { + it('lists all limited packages from the registry', async function () { const fetchLimitedPackageList = async () => { const response = await supertest .get('/api/ingest_manager/epm/packages/limited') @@ -46,9 +44,7 @@ export default function ({ getService }: FtrProviderContext) { }; const listResponse = await fetchLimitedPackageList(); expect(listResponse.response).to.eql(['endpoint']); - } else { - warnAndSkipTest(this, log); - } + }); }); }); } diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts index c3862d130202d6..654aa18fba523c 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts @@ -13,7 +13,7 @@ import { export default function (providerContext: FtrProviderContext) { const { loadTestFile, getService } = providerContext; - describe.skip('endpoint', function () { + describe('endpoint', function () { this.tags('ciGroup7'); const ingestManager = getService('ingestManager'); const log = getService('log');