Skip to content

Commit

Permalink
[Fleet] Fix Fleet API integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Apr 12, 2021
1 parent 0316787 commit 6454c33
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions x-pack/test/fleet_api_integration/apis/agents/reassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ export default function (providerContext: FtrProviderContext) {
await esArchiver.load('fleet/empty_fleet_server');
});
beforeEach(async () => {
await esArchiver.unload('fleet/empty_fleet_server');
await esArchiver.load('fleet/agents');
});
setupFleetAndAgents(providerContext);
afterEach(async () => {
await esArchiver.unload('fleet/agents');
await esArchiver.load('fleet/empty_fleet_server');
});
after(async () => {
await esArchiver.unload('fleet/empty_fleet_server');
Expand Down
5 changes: 4 additions & 1 deletion x-pack/test/fleet_api_integration/apis/agents/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ export default function (providerContext: FtrProviderContext) {
describe('fleet upgrade', () => {
skipIfNoDockerRegistry(providerContext);
before(async () => {
await esArchiver.loadIfNeeded('fleet/agents');
await esArchiver.load('fleet/agents');
});
setupFleetAndAgents(providerContext);
beforeEach(async () => {
await esArchiver.load('fleet/agents');
});
afterEach(async () => {
await esArchiver.unload('fleet/agents');
});
after(async () => {
await esArchiver.unload('fleet/agents');
});
Expand Down
5 changes: 2 additions & 3 deletions x-pack/test/fleet_api_integration/apis/agents_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default function (providerContext: FtrProviderContext) {
const es = getService('es');
const esArchiver = getService('esArchiver');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/96515
describe.skip('fleet_agents_setup', () => {
describe('fleet_agents_setup', () => {
skipIfNoDockerRegistry(providerContext);
before(async () => {
await esArchiver.load('empty_kibana');
Expand All @@ -25,7 +24,7 @@ export default function (providerContext: FtrProviderContext) {

after(async () => {
await esArchiver.unload('empty_kibana');
await esArchiver.load('fleet/empty_fleet_server');
await esArchiver.unload('fleet/empty_fleet_server');
});

beforeEach(async () => {
Expand Down
5 changes: 2 additions & 3 deletions x-pack/test/fleet_api_integration/apis/epm/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ export default function (providerContext: FtrProviderContext) {
// because `this` has to point to the Mocha context
// see https://mochajs.org/#arrow-functions

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/96515
describe.skip('EPM - list', async function () {
describe('EPM - list', async function () {
skipIfNoDockerRegistry(providerContext);
before(async () => {
await esArchiver.load('fleet/empty_fleet_server');
});
setupFleetAndAgents(providerContext);
after(async () => {
await esArchiver.load('fleet/empty_fleet_server');
await esArchiver.unload('fleet/empty_fleet_server');
});

describe('list api tests', async () => {
Expand Down
5 changes: 2 additions & 3 deletions x-pack/test/fleet_api_integration/apis/fleet_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default function (providerContext: FtrProviderContext) {
const es = getService('es');
const esArchiver = getService('esArchiver');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/96515
describe.skip('fleet_setup', () => {
describe('fleet_setup', () => {
skipIfNoDockerRegistry(providerContext);
before(async () => {
await esArchiver.load('empty_kibana');
Expand All @@ -25,7 +24,7 @@ export default function (providerContext: FtrProviderContext) {

after(async () => {
await esArchiver.unload('empty_kibana');
await esArchiver.load('fleet/empty_fleet_server');
await esArchiver.unload('fleet/empty_fleet_server');
});
beforeEach(async () => {
try {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { defineDockerServersConfig } from '@kbn/test';
// example: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/detail/snapshot/74/pipeline/257#step-302-log-1.
// It should be updated any time there is a new Docker image published for the Snapshot Distribution of the Package Registry.
export const dockerImage =
'docker.elastic.co/package-registry/distribution:c5925eb82898dfc3e879a521871c7383513804c7';
'docker.elastic.co/package-registry/distribution:07f236890c1dcf62f6a5702f80e44e835e04319d';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));
Expand Down
12 changes: 6 additions & 6 deletions x-pack/test/functional/es_archives/fleet/agents/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3074,7 +3074,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"auto_expand_replicas": "0-7",
"number_of_replicas": "0",
"number_of_shards": "1"
}
Expand All @@ -3089,7 +3089,7 @@
".fleet-actions": {
}
},
"index": ".fleet-actions_1",
"index": ".fleet-actions-7",
"mappings": {
"_meta": {
"migrationHash": "6527beea5a4a2f33acb599585ed4710442ece7f2"
Expand Down Expand Up @@ -3136,7 +3136,7 @@
".fleet-agents": {
}
},
"index": ".fleet-agents_1",
"index": ".fleet-agent-7",
"mappings": {
"_meta": {
"migrationHash": "87cab95ac988d78a78d0d66bbf05361b65dcbacf"
Expand Down Expand Up @@ -3373,7 +3373,7 @@
".fleet-enrollment-api-keys": {
}
},
"index": ".fleet-enrollment-api-keys_1",
"index": ".fleet-enrollment-api-keys-7",
"mappings": {
"_meta": {
"migrationHash": "06bef724726f3bea9f474a09be0a7f7881c28d4a"
Expand Down Expand Up @@ -3422,7 +3422,7 @@
".fleet-policies": {
}
},
"index": ".fleet-policies_1",
"index": ".fleet-policies-7",
"mappings": {
"_meta": {
"migrationHash": "c2c2a49b19562942fa7c1ff1537e66e751cdb4fa"
Expand Down Expand Up @@ -3466,7 +3466,7 @@
".fleet-servers": {
}
},
"index": ".fleet-servers_1",
"index": ".fleet-servers-7",
"mappings": {
"_meta": {
"migrationHash": "e2782448c7235ec9af66ca7997e867d715ac379c"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
".fleet-actions": {
}
},
"index": ".fleet-actions_1",
"index": ".fleet-actions-7",
"mappings": {
"_meta": {
"migrationHash": "6527beea5a4a2f33acb599585ed4710442ece7f2"
Expand Down Expand Up @@ -52,7 +52,7 @@
".fleet-agents": {
}
},
"index": ".fleet-agents_1",
"index": ".fleet-agents-7",
"mappings": {
"_meta": {
"migrationHash": "87cab95ac988d78a78d0d66bbf05361b65dcbacf"
Expand Down Expand Up @@ -289,7 +289,7 @@
".fleet-enrollment-api-keys": {
}
},
"index": ".fleet-enrollment-api-keys_1",
"index": ".fleet-enrollment-api-keys-7",
"mappings": {
"_meta": {
"migrationHash": "06bef724726f3bea9f474a09be0a7f7881c28d4a"
Expand Down Expand Up @@ -338,7 +338,7 @@
".fleet-policies": {
}
},
"index": ".fleet-policies_1",
"index": ".fleet-policies-7",
"mappings": {
"_meta": {
"migrationHash": "c2c2a49b19562942fa7c1ff1537e66e751cdb4fa"
Expand Down Expand Up @@ -382,7 +382,7 @@
".fleet-servers": {
}
},
"index": ".fleet-servers_1",
"index": ".fleet-servers-7",
"mappings": {
"_meta": {
"migrationHash": "e2782448c7235ec9af66ca7997e867d715ac379c"
Expand Down

0 comments on commit 6454c33

Please sign in to comment.