Skip to content

Commit

Permalink
[FTR] Use importExport for saved_object/basic archive (#100244) (#102016
Browse files Browse the repository at this point in the history
)

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley authored Jun 13, 2021
1 parent 73225da commit 9851b7b
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 126 deletions.
16 changes: 8 additions & 8 deletions test/api_integration/apis/kql_telemetry/kql_telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export default function ({ getService }: FtrProviderContext) {
const es = getService('es');

describe('telemetry API', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should increment the opt *in* counter in the .kibana/kql-telemetry document', async () => {
await supertest
Expand Down
8 changes: 4 additions & 4 deletions test/api_integration/apis/saved_objects/bulk_get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export default function ({ getService }: FtrProviderContext) {
);
});

after(() =>
kibanaServer.importExport.unload(
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200 with individual responses', async () =>
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects/bulk_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export default function ({ getService }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');

describe('bulkUpdate', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200', async () => {
const response = await supertest
Expand Down
8 changes: 4 additions & 4 deletions test/api_integration/apis/saved_objects/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export default function ({ getService }: FtrProviderContext) {
);
});

after(() =>
kibanaServer.importExport.unload(
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200', async () => {
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ export default function ({ getService }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');

describe('delete', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200 when deleting a doc', async () =>
await supertest
Expand Down
36 changes: 18 additions & 18 deletions test/api_integration/apis/saved_objects/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,18 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('`has_reference` and `has_reference_operator` parameters', () => {
before(() =>
kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references',
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json',
{ space: SPACE_ID }
)
);
after(() =>
kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references',
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json',
{ space: SPACE_ID }
)
);
);
});

it('search for a reference', async () => {
await supertest
Expand Down Expand Up @@ -333,18 +333,18 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('searching for special characters', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/find_edgecases.json',
{ space: SPACE_ID }
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/find_edgecases.json',
{ space: SPACE_ID }
)
);
);
});

it('can search for objects with dashes', async () =>
await supertest
Expand Down
8 changes: 4 additions & 4 deletions test/api_integration/apis/saved_objects/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default function ({ getService }: FtrProviderContext) {
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
);
});
after(() =>
kibanaServer.importExport.unload(
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200', async () =>
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ export default function ({ getService }: FtrProviderContext) {
};

describe('with basic data existing', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 415 when no file passed in', async () => {
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('with kibana index', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200', async () =>
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ export default function ({ getService }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');

describe('update', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});
it('should return 200', async () => {
await supertest
.put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`)
Expand Down
32 changes: 16 additions & 16 deletions test/api_integration/apis/saved_objects_management/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('with kibana index', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200 with individual responses', async () =>
await supertest
Expand Down Expand Up @@ -93,16 +93,16 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('`hasReference` and `hasReferenceOperator` parameters', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/references.json'
)
);
);
});

it('search for a reference', async () => {
await supertest
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/saved_objects_management/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ export default function ({ getService }: FtrProviderContext) {
const existingObject = 'visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab';
const nonexistentObject = 'wigwags/foo';

before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('should return 200 for object that exists and inject metadata', async () =>
await supertest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ export default function ({ getService }: FtrProviderContext) {
});

describe('relationships', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json'
)
);
);
});

const baseApiUrl = `/api/kibana/management/saved_objects/relationships`;
const defaultTypes = ['visualization', 'index-pattern', 'search', 'dashboard'];
Expand Down
16 changes: 8 additions & 8 deletions test/api_integration/apis/shorten/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default function ({ getService }) {
const kibanaServer = getService('kibanaServer');

describe('url shortener', () => {
before(() =>
kibanaServer.importExport.load(
before(async () => {
await kibanaServer.importExport.load(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
after(() =>
kibanaServer.importExport.unload(
);
});
after(async () => {
await kibanaServer.importExport.unload(
'test/api_integration/fixtures/kbn_archiver/saved_objects/basic.json'
)
);
);
});

it('generates shortened urls', async () => {
const resp = await supertest
Expand Down
Loading

0 comments on commit 9851b7b

Please sign in to comment.