Skip to content

Commit acd3e35

Browse files
authored
[Fleet] Rename ingest_manager_api_integration tests fleet_api_integration (#83011) (#83326)
1 parent 5f36a27 commit acd3e35

File tree

168 files changed

+107
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+107
-143
lines changed

src/dev/precommit_hook/casing_check_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const IGNORE_FILE_GLOBS = [
6969

7070
'x-pack/plugins/maps/server/fonts/**/*',
7171
// packages for the ingest manager's api integration tests could be valid semver which has dashes
72-
'x-pack/test/ingest_manager_api_integration/apis/fixtures/test_packages/**/*',
72+
'x-pack/test/fleet_api_integration/apis/fixtures/test_packages/**/*',
7373
];
7474

7575
/**

vars/kibanaPipeline.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def withFunctionalTestEnv(List additionalEnvs = [], Closure closure) {
8787
def kibanaPort = "61${parallelId}1"
8888
def esPort = "61${parallelId}2"
8989
def esTransportPort = "61${parallelId}3"
90-
def ingestManagementPackageRegistryPort = "61${parallelId}4"
90+
def fleetPackageRegistryPort = "61${parallelId}4"
9191
def alertingProxyPort = "61${parallelId}5"
9292

9393
withEnv([
@@ -100,7 +100,7 @@ def withFunctionalTestEnv(List additionalEnvs = [], Closure closure) {
100100
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
101101
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
102102
"KBN_NP_PLUGINS_BUILT=true",
103-
"INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=${ingestManagementPackageRegistryPort}",
103+
"FLEET_PACKAGE_REGISTRY_PORT=${fleetPackageRegistryPort}",
104104
"ALERTING_PROXY_PORT=${alertingProxyPort}"
105105
] + additionalEnvs) {
106106
closure()

x-pack/plugins/fleet/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ You need to have `docker` to run ingest manager api integration tests
5555
1. In one terminal, run the tests from the Kibana root directory with
5656

5757
```
58-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/ingest_manager_api_integration/config.ts
58+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/fleet_api_integration/config.ts
5959
```
6060

6161
1. in a second terminal, run the tests from the Kibana root directory with
6262

6363
```
64-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/ingest_manager_api_integration/config.ts
64+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/fleet_api_integration/config.ts
6565
```
6666

6767
Optionally you can filter which tests you want to run using `--grep`
6868

6969
```
70-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/ingest_manager_api_integration/config.ts --grep='fleet'
70+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/fleet_api_integration/config.ts --grep='fleet'
7171
```

x-pack/plugins/fleet/dev_docs/api_integration_tests.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ Many API integration tests for Ingest Manager trigger at some point a connection
55
- the deployed registry is temporarily unavailable
66
- the packages served by the registry do not match the expectation of the code under test
77

8-
For that reason, we run a dockerized version of the package registry in Kibana CI. For this to work, our tests must run against a custom test configuration and be kept in a custom directory, `x-pack/test/ingest_manager_api_integration`.
8+
For that reason, we run a dockerized version of the package registry in Kibana CI. For this to work, our tests must run against a custom test configuration and be kept in a custom directory, `x-pack/test/fleet_api_integration`.
99

1010
## How to run the tests locally
1111

1212
Usually, having the test server and the test runner in two different shells is most efficient, as it is possible to keep the server running and only rerun the test runner as often as needed. To do so, in one shell in the main `kibana` directory, run:
1313

1414
```
15-
$ export INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345
16-
$ yarn test:ftr:server --config x-pack/test/ingest_manager_api_integration/config.ts
15+
$ export FLEET_PACKAGE_REGISTRY_PORT=12345
16+
$ yarn test:ftr:server --config x-pack/test/fleet_api_integration/config.ts
1717
```
1818

1919
In another shell in the same directory, run
2020

2121
```
22-
$ export INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345
23-
$ yarn test:ftr:runner --config x-pack/test/ingest_manager_api_integration/config.ts
22+
$ export FLEET_PACKAGE_REGISTRY_PORT=12345
23+
$ yarn test:ftr:runner --config x-pack/test/fleet_api_integration/config.ts
2424
```
2525

2626
However, it is also possible to **alternatively** run everything in one go, again from the main `kibana` directory:
2727

2828
```
29-
$ export INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345
30-
$ yarn test:ftr --config x-pack/test/ingest_manager_api_integration/config.ts
29+
$ export FLEET_PACKAGE_REGISTRY_PORT=12345
30+
$ yarn test:ftr --config x-pack/test/fleet_api_integration/config.ts
3131
```
3232

3333
Port `12345` is used as an example here, it can be anything, but the environment variable has to be present for the tests to run at all.
@@ -37,7 +37,7 @@ Port `12345` is used as an example here, it can be anything, but the environment
3737
We use the `DockerServers` service provided by `kbn-test`. The documentation for this functionality can be found here:
3838
https://github.com/elastic/kibana/blob/master/packages/kbn-test/src/functional_test_runner/lib/docker_servers/README.md
3939

40-
The main configuration for the `DockerServers` service for our tests can be found in `x-pack/test/ingest_manager_api_integration/config.ts`:
40+
The main configuration for the `DockerServers` service for our tests can be found in `x-pack/test/fleet_api_integration/config.ts`:
4141

4242
### Specify the arguments to pass to `docker run`:
4343

@@ -74,13 +74,13 @@ The containerized package registry contains a set of packages which should be su
7474
docker run -p 8080:8080 docker.elastic.co/package-registry/package-registry:kibana-testing-1
7575
```
7676

77-
Additional packages for testing certain corner cases or error conditions can be put into `x-pack/test/ingest_manager_api_integration/apis/fixtures/test_packages`. A package `filetest` has been added there as an example.
77+
Additional packages for testing certain corner cases or error conditions can be put into `x-pack/test/fleet_api_integration/apis/fixtures/test_packages`. A package `filetest` has been added there as an example.
7878

7979
## Some DockerServers background
8080

81-
For the `DockerServers` servers to run correctly in CI, the `INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT` environment variable needs to be under control of the CI environment. The reason behind this: it is possible that several versions of our tests are run in parallel on the same worker in Jenkins, and if we used a hard-coded port number here, those tests would run into port conflicts. (This is also the case for a few other ports, and the setup happens in `vars/kibanaPipeline.groovy`).
81+
For the `DockerServers` servers to run correctly in CI, the `FLEET_PACKAGE_REGISTRY_PORT` environment variable needs to be under control of the CI environment. The reason behind this: it is possible that several versions of our tests are run in parallel on the same worker in Jenkins, and if we used a hard-coded port number here, those tests would run into port conflicts. (This is also the case for a few other ports, and the setup happens in `vars/kibanaPipeline.groovy`).
8282

83-
Also, not every developer has `docker` installed on their workstation, so it must be possible to run the testsuite as a whole without `docker`, and preferably this should be the default behaviour. Therefore, our `DockerServers` service is only enabled when `INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT` is set. This needs to be checked in every test like this:
83+
Also, not every developer has `docker` installed on their workstation, so it must be possible to run the testsuite as a whole without `docker`, and preferably this should be the default behaviour. Therefore, our `DockerServers` service is only enabled when `FLEET_PACKAGE_REGISTRY_PORT` is set. This needs to be checked in every test like this:
8484

8585
```
8686
it('fetches a .json search file', async function () {
@@ -105,7 +105,7 @@ If the tests are skipped in this way, they are marked in the test summary as `pe
105105
└-> "before all" hook
106106
└-> lists all packages from the registry
107107
└-> "before each" hook: global before each
108-
│ warn disabling tests because DockerServers service is not enabled, set INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT to run them
108+
│ warn disabling tests because DockerServers service is not enabled, set FLEET_PACKAGE_REGISTRY_PORT to run them
109109
└-> lists all packages from the registry
110110
└-> "after all" hook
111111
[...]

x-pack/plugins/security_solution/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The endpoint functional tests are located [here](../../test/security_solution_en
2828
### Using Docker
2929

3030
To run the tests using the recommended docker image version you must have `docker` installed. The testing infrastructure
31-
will stand up a docker container using the image defined [here](../../test/ingest_manager_api_integration/config.ts#L15)
31+
will stand up a docker container using the image defined [here](../../test/fleet_api_integration/config.ts#L15)
3232

3333
Make sure you're in the Kibana root directory.
3434

@@ -37,27 +37,27 @@ Make sure you're in the Kibana root directory.
3737
In one terminal, run:
3838

3939
```bash
40-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts
40+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts
4141
```
4242

4343
In another terminal, run:
4444

4545
```bash
46-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts
46+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts
4747
```
4848

4949
#### Endpoint Functional Tests
5050

5151
In one terminal, run:
5252

5353
```bash
54-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts
54+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts
5555
```
5656

5757
In another terminal, run:
5858

5959
```bash
60-
INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts
60+
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts
6161
```
6262

6363
### Running your own package registry

x-pack/scripts/functional_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ require('@kbn/test').runTestsCli([
6363
require.resolve('../test/reporting_api_integration/reporting_and_security.config.ts'),
6464
require.resolve('../test/reporting_api_integration/reporting_without_security.config.ts'),
6565
require.resolve('../test/security_solution_endpoint_api_int/config.ts'),
66-
require.resolve('../test/ingest_manager_api_integration/config.ts'),
66+
require.resolve('../test/fleet_api_integration/config.ts'),
6767
require.resolve('../test/functional_enterprise_search/without_host_configured.config.ts'),
6868
require.resolve('../test/functional_vis_wizard/config.ts'),
6969
require.resolve('../test/saved_object_tagging/functional/config.ts'),

x-pack/test/ingest_manager_api_integration/apis/agent_policy/agent_policy.ts renamed to x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function ({ getService }: FtrProviderContext) {
1111
const supertest = getService('supertest');
1212
const esArchiver = getService('esArchiver');
1313

14-
describe('ingest_manager_agent_policies', () => {
14+
describe('fleet_agent_policies', () => {
1515
const createdPolicyIds: string[] = [];
1616
after(async () => {
1717
const deletedPromises = createdPolicyIds.map((agentPolicyId) =>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import expect from '@kbn/expect';
88
import { skipIfNoDockerRegistry } from '../../helpers';
99
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
10-
import { setupIngest, getSupertestWithoutAuth } from '../fleet/agents/services';
10+
import { setupFleetAndAgents, getSupertestWithoutAuth } from '../agents/services';
1111

1212
export default function (providerContext: FtrProviderContext) {
1313
const { getService } = providerContext;
@@ -68,7 +68,7 @@ export default function (providerContext: FtrProviderContext) {
6868
}
6969

7070
// Test all the side effect that should occurs when we create|update an agent policy
71-
describe('ingest_manager_agent_policies_with_agents_setup', () => {
71+
describe('fleet_agent_policies_with_agents_setup', () => {
7272
skipIfNoDockerRegistry(providerContext);
7373

7474
before(async () => {
@@ -78,7 +78,7 @@ export default function (providerContext: FtrProviderContext) {
7878
await esArchiver.unload('fleet/agents');
7979
});
8080

81-
setupIngest(providerContext);
81+
setupFleetAndAgents(providerContext);
8282

8383
describe('POST /api/fleet/agent_policies', () => {
8484
it('should create an enrollment key and an agent action `POLICY_CHANGE` for the policy', async () => {

x-pack/test/ingest_manager_api_integration/apis/agent_policy/index.js renamed to x-pack/test/fleet_api_integration/apis/agent_policy/index.js

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

77
export default function loadTests({ loadTestFile }) {
8-
describe('Ingest Manager Endpoints', () => {
8+
describe('Fleet Endpoints', () => {
99
loadTestFile(require.resolve('./agent_policy_with_agents_setup'));
1010
loadTestFile(require.resolve('./agent_policy'));
1111
});

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

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

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

1212
export default function (providerContext: FtrProviderContext) {

0 commit comments

Comments
 (0)