Skip to content

Commit

Permalink
[APM] Enable APM integration e2e tests (elastic#125724)
Browse files Browse the repository at this point in the history
* removing package registry docker

* unused imports

* not used

* fixing ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and lucasfcosta committed Mar 2, 2022
1 parent 0b8bf50 commit 30ab99e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
8 changes: 0 additions & 8 deletions x-pack/plugins/apm/ftr_e2e/ftr_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import { FtrConfigProviderContext } from '@kbn/test';
import { CA_CERT_PATH } from '@kbn/dev-utils';

// Used to spin up a docker container with package registry service that will be used by fleet
export const packageRegistryPort = 1234;

async function config({ readConfigFile }: FtrConfigProviderContext) {
const kibanaCommonTestsConfig = await readConfigFile(
require.resolve('../../../../test/common/config.js')
Expand Down Expand Up @@ -41,11 +38,6 @@ async function config({ readConfigFile }: FtrConfigProviderContext) {
'--csp.warnLegacyBrowsers=false',
// define custom kibana server args here
`--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`,

// Fleet config
`--xpack.fleet.packages.0.name=endpoint`,
`--xpack.fleet.packages.0.version=latest`,
`--xpack.fleet.registryUrl=http://localhost:${packageRegistryPort}`,
],
},
};
Expand Down
26 changes: 1 addition & 25 deletions x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,17 @@
* 2.0.
*/

import { defineDockerServersConfig, FtrConfigProviderContext } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test';
import cypress from 'cypress';
import path from 'path';
import { cypressStart } from './cypress_start';
import { packageRegistryPort } from './ftr_config';
import { FtrProviderContext } from './ftr_provider_context';

export const dockerImage =
'docker.elastic.co/package-registry/distribution@sha256:c5bf8e058727de72e561b228f4b254a14a6f880e582190d01bd5ff74318e1d0b';

async function ftrConfigRun({ readConfigFile }: FtrConfigProviderContext) {
const kibanaConfig = await readConfigFile(require.resolve('./ftr_config.ts'));

// mount the config file for the package registry
const dockerArgs: string[] = [
'-v',
`${path.join(
path.dirname(__filename),
'./apis/fixtures/package_registry_config.yml'
)}:/package-registry/config.yml`,
];

return {
...kibanaConfig.getAll(),
testRunner,
dockerServers: defineDockerServersConfig({
registry: {
enabled: true,
image: dockerImage,
portInContainer: 8080,
port: packageRegistryPort,
args: dockerArgs,
waitForLogLine: 'package manifests loaded',
},
}),
};
}

Expand Down

0 comments on commit 30ab99e

Please sign in to comment.