Skip to content

Commit 90c8406

Browse files
authored
[Ingest Manager] Use docker registry for fleet api integration tests (#72621)
1 parent 8f7ccc7 commit 90c8406

File tree

23 files changed

+119
-124
lines changed

23 files changed

+119
-124
lines changed

x-pack/plugins/ingest_manager/README.md

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -45,63 +45,26 @@ One common development workflow is:
4545
This plugin follows the `common`, `server`, `public` structure from the [Architecture Style Guide
4646
](https://github.com/elastic/kibana/blob/master/style_guides/architecture_style_guide.md#file-and-folder-structure). We also follow the pattern of developing feature branches under your personal fork of Kibana.
4747

48-
### API Tests
48+
### Tests
4949

50-
#### Ingest & Fleet
50+
#### API integration tests
5151

52-
1. In one terminal, change to the `x-pack` directory and start the test server with
52+
You need to have `docker` to run ingest manager api integration tests
5353

54-
```
55-
node scripts/functional_tests_server.js --config test/api_integration/config.ts
56-
```
54+
1. In one terminal, run the tests from the Kibana root directory with
5755

58-
1. in a second terminal, run the tests from the Kibana root directory with
5956
```
60-
node scripts/functional_test_runner.js --config x-pack/test/api_integration/config.ts
57+
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/ingest_manager_api_integration/config.ts
6158
```
6259

63-
#### EPM
64-
65-
1. In one terminal, change to the `x-pack` directory and start the test server with
60+
1. in a second terminal, run the tests from the Kibana root directory with
6661

6762
```
68-
node scripts/functional_tests_server.js --config test/epm_api_integration/config.ts
63+
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/ingest_manager_api_integration/config.ts
6964
```
7065

71-
1. in a second terminal, run the tests from the Kibana root directory with
66+
Optionally you can filter which tests you want to run using `--grep`
67+
7268
```
73-
node scripts/functional_test_runner.js --config x-pack/test/epm_api_integration/config.ts
69+
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/ingest_manager_api_integration/config.ts --grep='fleet'
7470
```
75-
76-
### Staying up-to-date with `master`
77-
78-
While we're developing in the `feature-ingest` feature branch, here's is more information on keeping up to date with upstream kibana.
79-
80-
<details>
81-
<summary>merge upstream <code>master</code> into <code>feature-ingest</code></summary>
82-
83-
```bash
84-
## checkout feature branch to your fork
85-
git checkout -B feature-ingest origin/feature-ingest
86-
87-
## make sure your feature branch is current with upstream feature branch
88-
git pull upstream feature-ingest
89-
90-
## pull in changes from upstream master
91-
git pull upstream master
92-
93-
## push changes to your remote
94-
git push origin
95-
96-
# /!\ Open a DRAFT PR /!\
97-
# Normal PRs will re-notify authors of commits already merged
98-
# Draft PR will trigger CI run. Once CI is green ...
99-
# /!\ DO NOT USE THE GITHUB UI TO MERGE THE PR /!\
100-
101-
## push your changes to upstream feature branch from the terminal; not GitHub UI
102-
git push upstream
103-
```
104-
105-
</details>
106-
107-
See https://github.com/elastic/kibana/pull/37950 for an example.

x-pack/test/api_integration/apis/endpoint/artifacts/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { createHash } from 'crypto';
99
import { inflateSync } from 'zlib';
1010

1111
import { FtrProviderContext } from '../../../ftr_provider_context';
12-
import { getSupertestWithoutAuth, setupIngest } from '../../fleet/agents/services';
12+
import {
13+
getSupertestWithoutAuth,
14+
setupIngest,
15+
} from '../../../../ingest_manager_api_integration/apis/fleet/agents/services';
1316

1417
export default function (providerContext: FtrProviderContext) {
1518
const { getService } = providerContext;

x-pack/test/api_integration/apis/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ export default function ({ loadTestFile }) {
2626
loadTestFile(require.resolve('./security_solution'));
2727
loadTestFile(require.resolve('./short_urls'));
2828
loadTestFile(require.resolve('./lens'));
29-
loadTestFile(require.resolve('./fleet'));
3029
loadTestFile(require.resolve('./ml'));
3130
loadTestFile(require.resolve('./transform'));
3231
loadTestFile(require.resolve('./endpoint'));
33-
loadTestFile(require.resolve('./ingest_manager'));
3432
loadTestFile(require.resolve('./lists'));
3533
loadTestFile(require.resolve('./upgrade_assistant'));
3634
});

x-pack/test/api_integration/apis/ingest_manager/agent_config.ts renamed to x-pack/test/ingest_manager_api_integration/apis/agent_config/agent_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import expect from '@kbn/expect';
8-
import { FtrProviderContext } from '../../ftr_provider_context';
8+
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
99

1010
export default function ({ getService }: FtrProviderContext) {
1111
const supertest = getService('supertest');

x-pack/test/api_integration/apis/fleet/agents/acks.ts renamed to x-pack/test/ingest_manager_api_integration/apis/fleet/agents/acks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
import expect from '@kbn/expect';
88
import uuid from 'uuid';
9-
10-
import { FtrProviderContext } from '../../../ftr_provider_context';
9+
import { FtrProviderContext } from '../../../../api_integration/ftr_provider_context';
1110
import { getSupertestWithoutAuth } from './services';
1211

1312
export default function (providerContext: FtrProviderContext) {

x-pack/test/api_integration/apis/fleet/agents/actions.ts renamed to x-pack/test/ingest_manager_api_integration/apis/fleet/agents/actions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
*/
66

77
import expect from '@kbn/expect';
8-
9-
import { FtrProviderContext } from '../../../ftr_provider_context';
8+
import { FtrProviderContext } from '../../../../api_integration/ftr_provider_context';
109

1110
export default function (providerContext: FtrProviderContext) {
1211
const { getService } = providerContext;

x-pack/test/api_integration/apis/fleet/agents/checkin.ts renamed to x-pack/test/ingest_manager_api_integration/apis/fleet/agents/checkin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import expect from '@kbn/expect';
88
import uuid from 'uuid';
99

10-
import { FtrProviderContext } from '../../../ftr_provider_context';
10+
import { FtrProviderContext } from '../../../../api_integration/ftr_provider_context';
1111
import { getSupertestWithoutAuth, setupIngest } from './services';
12+
import { skipIfNoDockerRegistry } from '../../../helpers';
1213

1314
export default function (providerContext: FtrProviderContext) {
1415
const { getService } = providerContext;
@@ -19,6 +20,7 @@ export default function (providerContext: FtrProviderContext) {
1920
let apiKey: { id: string; api_key: string };
2021

2122
describe('fleet_agents_checkin', () => {
23+
skipIfNoDockerRegistry(providerContext);
2224
before(async () => {
2325
await esArchiver.loadIfNeeded('fleet/agents');
2426

x-pack/test/api_integration/apis/fleet/agent_flow.ts renamed to x-pack/test/ingest_manager_api_integration/apis/fleet/agents/complete_flow.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
import expect from '@kbn/expect';
88

9-
import { FtrProviderContext } from '../../ftr_provider_context';
10-
import { setupIngest, getSupertestWithoutAuth } from './agents/services';
9+
import { FtrProviderContext } from '../../../../api_integration/ftr_provider_context';
10+
import { setupIngest, getSupertestWithoutAuth } from './services';
11+
import { skipIfNoDockerRegistry } from '../../../helpers';
1112

1213
export default function (providerContext: FtrProviderContext) {
1314
const { getService } = providerContext;
@@ -19,6 +20,7 @@ export default function (providerContext: FtrProviderContext) {
1920
const esClient = getService('es');
2021

2122
describe('fleet_agent_flow', () => {
23+
skipIfNoDockerRegistry(providerContext);
2224
before(async () => {
2325
await esArchiver.load('empty_kibana');
2426
});

x-pack/test/api_integration/apis/fleet/delete_agent.ts renamed to x-pack/test/ingest_manager_api_integration/apis/fleet/agents/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import expect from '@kbn/expect';
8-
import { FtrProviderContext } from '../../ftr_provider_context';
8+
import { FtrProviderContext } from '../../../../api_integration/ftr_provider_context';
99

1010
export default function ({ getService }: FtrProviderContext) {
1111
const esArchiver = getService('esArchiver');

0 commit comments

Comments
 (0)