diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index 33abe151b7d293..c2fa6b051637a7 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -13,7 +13,9 @@ require('@kbn/test').runTestsCli([ require.resolve('../test/functional/config.js'), require.resolve('../test/api_integration/config.js'), require.resolve('../test/saml_api_integration/config.js'), - require.resolve('../test/rbac_api_integration/config.js'), require.resolve('../test/spaces_api_integration/spaces_only/config.js'), require.resolve('../test/spaces_api_integration/security_and_spaces/config.js'), + require.resolve('../test/saved_object_api_integration/security_and_spaces/config'), + require.resolve('../test/saved_object_api_integration/security_only/config'), + require.resolve('../test/saved_object_api_integration/spaces_only/config'), ]); diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts index ab62907cb897c3..5b65722d7b0b26 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../../common/lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface BulkGetTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/common/suites/create.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/common/suites/create.ts index 38b3592098b459..e6ffee7d75add7 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface CreateTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/common/suites/delete.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/common/suites/delete.ts index 3f54b4238399b7..26f2b903bb0145 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/delete.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface DeleteTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/common/suites/find.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/common/suites/find.ts index 554b5fc4928d45..9b1f6e82ab4308 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../../common/lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface FindTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/common/suites/get.ts similarity index 94% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/common/suites/get.ts index 7164fdfbc7f164..f6526dcf5a9492 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { DescribeFn, TestDefinitionAuthentication } from '../../../common/lib/types'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface GetTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/common/suites/update.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/common/suites/update.ts index 51b8bc202c9fcd..c4f941ef16f613 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/update.ts @@ -5,9 +5,9 @@ */ import expect from 'expect.js'; -import { DEFAULT_SPACE_ID } from '../../../../../plugins/spaces/common/constants'; -import { getIdPrefix, getUrlPrefix } from '../../lib/space_test_utils'; -import { DescribeFn, TestDefinitionAuthentication } from '../../lib/types'; +import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; +import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; +import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; interface UpdateTest { statusCode: number; diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts similarity index 95% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts index e984016185900b..58456ac6debaac 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts index af05cdaa5f54cf..09b40f238bae25 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts index d5fe0cce520896..88031abf193118 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts similarity index 98% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts index e9ec47f8ee56f8..0d984d629240de 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts index 0e6ecaeab96bf4..96c2363aeff1b2 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts index 8dc2fec5190cd5..2a65f56b523d79 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts @@ -3,19 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; // tslint:disable:no-default-export -export default function({ loadTestFile, getService }: TestInvoker) { +export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); - describe('security and spaces enabled', () => { + describe('saved objects security and spaces enabled', () => { before(async () => { await createUsersAndRoles(es, supertest); }); - loadTestFile(require.resolve('./saved_objects')); + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts deleted file mode 100644 index b0f3ceb14e8a60..00000000000000 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts index 720fef5fb62b37..62fc3b562e4c3f 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts similarity index 96% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts index 07f5455cd8ae2b..60aaf8b64d86d5 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/create.ts index 0390bac48d4d53..21050effbdd996 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/delete.ts index 3ff5a851c908a8..634a3d60f1322c 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts similarity index 98% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/find.ts index 3b1d98a4f4fa3c..84440d87275fb7 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/get.ts index d6ab9b1aae95d4..c915450bb8a447 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts index a4cc59af0b7305..6c3a258112f4c1 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts @@ -3,19 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; // tslint:disable:no-default-export -export default function({ loadTestFile, getService }: TestInvoker) { +export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); - describe('security only enabled', () => { + describe('saved objects security only enabled', () => { before(async () => { await createUsersAndRoles(es, supertest); }); - loadTestFile(require.resolve('./saved_objects')); + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts deleted file mode 100644 index 1b1ae2c8a3c4de..00000000000000 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts similarity index 97% rename from x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/security_only/apis/update.ts index 88b038f2756068..ab967d6611a007 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AUTHENTICATION } from '../../../common/lib/authentication'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { AUTHENTICATION } from '../../common/lib/authentication'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts similarity index 85% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts index 1f270bfd046d3f..cfb4b301bccfb3 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { bulkGetTestSuiteFactory } from '../../../common/suites/saved_objects/bulk_get'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts similarity index 87% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts index 488404e2bb86e1..4da115377f23ff 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { createTestSuiteFactory } from '../../../common/suites/saved_objects/create'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { createTestSuiteFactory } from '../../common/suites/create'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts similarity index 88% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts index d56124a903dd5e..d70f930d636772 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/delete.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { deleteTestSuiteFactory } from '../../../common/suites/saved_objects/delete'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { deleteTestSuiteFactory } from '../../common/suites/delete'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts similarity index 92% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts index 83403fdcea08b8..51f4a8623667a2 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/find.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { findTestSuiteFactory } from '../../../common/suites/saved_objects/find'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { findTestSuiteFactory } from '../../common/suites/find'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts similarity index 87% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts index 138dc82532a0a7..d1f578808c6d54 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { getTestSuiteFactory } from '../../../common/suites/saved_objects/get'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { getTestSuiteFactory } from '../../common/suites/get'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) { diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts index a1c07ab90e7628..e3788a03c0e2ee 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts @@ -4,17 +4,24 @@ * you may not use this file except in compliance with the Elastic License. */ +import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - // tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('apis spaces', () => { - loadTestFile(require.resolve('./saved_objects')); +export default function({ getService, loadTestFile }: TestInvoker) { + const es = getService('es'); + const supertest = getService('supertest'); + + describe('saved objects spaces only enabled', () => { + before(async () => { + await createUsersAndRoles(es, supertest); + }); + + loadTestFile(require.resolve('./bulk_get')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts deleted file mode 100644 index 1b1ae2c8a3c4de..00000000000000 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { TestInvoker } from '../../../common/lib/types'; - -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// tslint:disable:no-default-export -export default function({ loadTestFile }: TestInvoker) { - describe('saved_objects', () => { - loadTestFile(require.resolve('./bulk_get')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./find')); - loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); - }); -} diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts similarity index 88% rename from x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts rename to x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts index fe335489f7c8d8..c22ef7fe17e133 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/saved_objects/update.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SPACES } from '../../../common/lib/spaces'; -import { TestInvoker } from '../../../common/lib/types'; -import { updateTestSuiteFactory } from '../../../common/suites/saved_objects/update'; +import { SPACES } from '../../common/lib/spaces'; +import { TestInvoker } from '../../common/lib/types'; +import { updateTestSuiteFactory } from '../../common/suites/update'; // tslint:disable:no-default-export export default function({ getService }: TestInvoker) {