Skip to content

Commit

Permalink
[7.11] [functional_cors] use pre-defined unique port in CI (#88919) (#…
Browse files Browse the repository at this point in the history
…88979)

Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: spalger <spalger@users.noreply.github.com>
  • Loading branch information
Spencer and spalger committed Jan 21, 2021
1 parent b0efd68 commit e8c1058
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .ci/teamcity/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ else
fi

tc_set_env FLEET_PACKAGE_REGISTRY_PORT 6104 # Any unused port is fine, used by ingest manager tests
tc_set_env TEST_CORS_SERVER_PORT 6105 # Any unused port is fine, used by ingest manager tests

if [[ "$(which google-chrome-stable)" || "$(which google-chrome)" ]]; then
echo "Chrome detected, setting DETECT_CHROMEDRIVER_VERSION=true"
Expand Down
2 changes: 2 additions & 0 deletions vars/kibanaPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def withFunctionalTestEnv(List additionalEnvs = [], Closure closure) {
def esTransportPort = "61${parallelId}3"
def fleetPackageRegistryPort = "61${parallelId}4"
def alertingProxyPort = "61${parallelId}5"
def corsTestServerPort = "61${parallelId}6"
def apmActive = githubPr.isPr() ? "false" : "true"

withEnv([
Expand All @@ -100,6 +101,7 @@ def withFunctionalTestEnv(List additionalEnvs = [], Closure closure) {
"TEST_KIBANA_URL=http://elastic:changeme@localhost:${kibanaPort}",
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
"TEST_CORS_SERVER_PORT=${corsTestServerPort}",
"KBN_NP_PLUGINS_BUILT=true",
"FLEET_PACKAGE_REGISTRY_PORT=${fleetPackageRegistryPort}",
"ALERTING_PROXY_PORT=${alertingProxyPort}",
Expand Down
6 changes: 4 additions & 2 deletions x-pack/test/functional_cors/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

import Url from 'url';
import Path from 'path';
import getPort from 'get-port';
import type { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { kbnTestConfig } from '@kbn/test';
import { pageObjects } from '../functional/page_objects';

const pluginPort = process.env.TEST_CORS_SERVER_PORT
? parseInt(process.env.TEST_CORS_SERVER_PORT, 10)
: 5699;

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kibanaFunctionalConfig = await readConfigFile(require.resolve('../functional/config.js'));

Expand All @@ -27,7 +30,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
};

const { protocol, hostname } = kbnTestConfig.getUrlParts();
const pluginPort = await getPort();
const originUrl = Url.format({
protocol,
hostname,
Expand Down

0 comments on commit e8c1058

Please sign in to comment.