[7.x] [functional_cors] use pre-defined unique port in CI (#88919) (#88978)

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

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2021-01-21 10:46:28 -07:00 committed by GitHub
parent 99cd66f72d
commit c7713f216d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -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"

View file

@ -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([
@ -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}",

View file

@ -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'));
@ -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,