Skip to content

Commit

Permalink
[Fleet] Update docker image of registry used in integration tests (el…
Browse files Browse the repository at this point in the history
…astic#101911)

## Summary

 * Use a more recent Docker image for package registry used in integration/API tests. 
    * [New image](https://container-library.elastic.co/r/package-registry/distribution:fc104ac437370d80518e24da6d0b84370edf0c0c) is from Jun-14 [old image](https://container-library.elastic.co/r/package-registry/distribution:b6a53ac9300333a4a45f3f7d350c9aed72061a66) is from Apr-14
 * Add support for using a custom Docker registry using `FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE` env var
    * e.g. `production` tag
    ```
    FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE='docker.elastic.co/package-registry/distribution:production' FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner
    ```
    or a personal one
    ```
    FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE='docker.elastic.co/employees/jfsiii/package-registry-distribution:kb90454' FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner

    ```

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
  • Loading branch information
John Schulz authored and kibanamachine committed Jun 17, 2021
1 parent a78a84d commit 9b78c31
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions x-pack/plugins/fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ You need to have `docker` to run ingest manager api integration tests
```
FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/fleet_api_integration/config.ts --grep='fleet'
```

**Note** you can also supply which docker image to use for the package registry via the `FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE` env variable. For example,

```
FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE='docker.elastic.co/package-registry/distribution:production' FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner
```
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/epm/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { skipIfNoDockerRegistry } from '../../helpers';
export default function (providerContext: FtrProviderContext) {
const { getService } = providerContext;
const supertest = getService('supertest');
const requiredPackage = 'system-0.11.0';
const requiredPackage = 'system-0.12.6';

const installPackage = async (pkgkey: string) => {
await supertest
Expand Down
3 changes: 2 additions & 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,8 @@ 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:b6a53ac9300333a4a45f3f7d350c9aed72061a66';
process.env.FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE ||
'docker.elastic.co/package-registry/distribution:fc104ac437370d80518e24da6d0b84370edf0c0c';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));
Expand Down

0 comments on commit 9b78c31

Please sign in to comment.