Skip to content

Commit

Permalink
Added server and runner script
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Mar 1, 2021
1 parent 6c4222f commit c26d77b
Show file tree
Hide file tree
Showing 21 changed files with 9,594 additions and 0 deletions.
56 changes: 56 additions & 0 deletions x-pack/plugins/uptime/e2e/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { resolve } from 'path';

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';

import { CA_CERT_PATH } from '@kbn/dev-utils';
async function config({ readConfigFile }: FtrConfigProviderContext) {
const kibanaCommonTestsConfig = await readConfigFile(
require.resolve('../../../../test/common/config.js')
);
const xpackFunctionalTestsConfig = await readConfigFile(
require.resolve('../../../test/functional/config.js')
);

return {
...kibanaCommonTestsConfig.getAll(),

esArchiver: {
directory: resolve(__dirname, 'elastic_synthetics/fixtures/es_archiver'),
},

esTestCluster: {
skipEsCluster: true,
...xpackFunctionalTestsConfig.get('esTestCluster'),
serverArgs: [
...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'),
// define custom es server here
// API Keys is enabled at the top level
'xpack.security.enabled=true',
],
},

kbnTestServer: {
...xpackFunctionalTestsConfig.get('kbnTestServer'),
serverArgs: [
...xpackFunctionalTestsConfig.get('kbnTestServer.serverArgs'),
'--csp.strict=false',
// define custom kibana server args here
`--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`,
`--elasticsearch.ignoreVersionMismatch=true`,
`--uiSettings.overrides.theme:darkMode=true`,
`--elasticsearch.username=kibana_system`,
`--elasticsearch.password=changeme`,
],
},
};
}

// eslint-disable-next-line import/no-default-export
export default config;
43 changes: 43 additions & 0 deletions x-pack/plugins/uptime/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: '3.7'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
container_name: uptime-e2e-es
healthcheck:
test:
['CMD-SHELL', 'curl -s http://localhost:9220/_cluster/health | grep -vq ''"status":"red"''']
retries: 10
interval: 20s
environment:
- node.name=elasticsearch
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=elasticsearch
- bootstrap.memory_lock=true
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- ELASTICSEARCH_PORT=9220
- xpack.security.enabled=true
- ELASTIC_PASSWORD=changeme
ulimits:
memlock:
soft: -1
hard: -1
ports:
- '9220:9200'
- '9320:9300'
expose:
- '9220'
networks:
- elastic
heartbeat:
image: docker.elastic.co/beats/heartbeat:${STACK_VERSION}
container_name: uptime-e2e-heartbeat
depends_on:
- elasticsearch
volumes:
- ./heartbeat.docker.yml:/usr/share/heartbeat/heartbeat.yml:ro
networks:
- elastic

networks:
elastic:
driver: bridge
Empty file.
Loading

0 comments on commit c26d77b

Please sign in to comment.