Skip to content

Commit

Permalink
[Fleet] Fix Fleet API integration tests (#96837) (#96994)
Browse files Browse the repository at this point in the history
# Conflicts:
#	x-pack/scripts/functional_tests.js
  • Loading branch information
nchaulet authored Apr 13, 2021
1 parent 0208b63 commit 558acf5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
3 changes: 1 addition & 2 deletions x-pack/scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ require('@kbn/test').runTestsCli([
require.resolve('../test/reporting_api_integration/reporting_and_security.config.ts'),
require.resolve('../test/reporting_api_integration/reporting_without_security.config.ts'),
require.resolve('../test/security_solution_endpoint_api_int/config.ts'),
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/96515
// require.resolve('../test/fleet_api_integration/config.ts'),
require.resolve('../test/fleet_api_integration/config.ts'),
require.resolve('../test/functional_enterprise_search/without_host_configured.config.ts'),
require.resolve('../test/functional_vis_wizard/config.ts'),
require.resolve('../test/search_sessions_integration/config.ts'),
Expand Down
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
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/agents_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,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
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/epm/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function (providerContext: FtrProviderContext) {
});
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
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/fleet_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,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
10 changes: 5 additions & 5 deletions x-pack/test/functional/es_archives/fleet/agents/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 558acf5

Please sign in to comment.