From 873a7f060437bce1666c493221a66d2ded7e2c18 Mon Sep 17 00:00:00 2001 From: delvedor Date: Mon, 8 Feb 2021 17:20:10 +0100 Subject: [PATCH 1/3] Updated CI configuration --- .ci/functions/imports.sh | 5 ++--- .ci/run-elasticsearch.sh | 6 +++--- .ci/run-repository.sh | 2 +- .ci/test-matrix.yml | 4 ++-- test/integration/index.js | 28 ++++++++++++++-------------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.ci/functions/imports.sh b/.ci/functions/imports.sh index e022a3be9..3fb28cc38 100644 --- a/.ci/functions/imports.sh +++ b/.ci/functions/imports.sh @@ -18,7 +18,7 @@ require_stack_version if [[ -z $es_node_name ]]; then # only set these once set -euo pipefail - export TEST_SUITE=${TEST_SUITE-oss} + export TEST_SUITE=${TEST_SUITE-free} export RUNSCRIPTS=${RUNSCRIPTS-} export DETACH=${DETACH-false} export CLEANUP=${CLEANUP-false} @@ -27,8 +27,7 @@ if [[ -z $es_node_name ]]; then export elastic_password=changeme export elasticsearch_image=elasticsearch export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200 - if [[ $TEST_SUITE != "xpack" ]]; then - export elasticsearch_image=elasticsearch-${TEST_SUITE} + if [[ $TEST_SUITE != "platinum" ]]; then export elasticsearch_url=http://${es_node_name}:9200 fi export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost} diff --git a/.ci/run-elasticsearch.sh b/.ci/run-elasticsearch.sh index 91a11027a..ff7cb14fe 100755 --- a/.ci/run-elasticsearch.sh +++ b/.ci/run-elasticsearch.sh @@ -4,7 +4,7 @@ # to form a cluster suitable for running the REST API tests. # # Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'. -# Export the TEST_SUITE variable, eg. 'oss' or 'xpack' defaults to 'oss'. +# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'. # Export the NUMBER_OF_NODES variable to start more than 1 node # Version 1.2.0 @@ -39,7 +39,7 @@ environment=($(cat <<-END --env repositories.url.allowed_urls=http://snapshot.test* END )) -if [[ "$TEST_SUITE" == "xpack" ]]; then +if [[ "$TEST_SUITE" == "platinum" ]]; then environment+=($(cat <<-END --env ELASTIC_PASSWORD=$elastic_password --env xpack.license.self_generated.type=trial @@ -64,7 +64,7 @@ END fi cert_validation_flags="" -if [[ "$TEST_SUITE" == "xpack" ]]; then +if [[ "$TEST_SUITE" == "platinum" ]]; then cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1" fi diff --git a/.ci/run-repository.sh b/.ci/run-repository.sh index 64c5b413e..b64c38d96 100755 --- a/.ci/run-repository.sh +++ b/.ci/run-repository.sh @@ -2,7 +2,7 @@ # parameters are available to this script # STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease) -# TEST_SUITE -- which test suite to run: oss or xpack +# TEST_SUITE -- which test suite to run: free or platinum # ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE # NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here) script_path=$(dirname $(realpath -s $0)) diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml index 1c6423ab7..d33e57e4b 100644 --- a/.ci/test-matrix.yml +++ b/.ci/test-matrix.yml @@ -9,7 +9,7 @@ NODE_JS_VERSION: - 8 TEST_SUITE: - - oss - - xpack + - free + - platinum exclude: ~ diff --git a/test/integration/index.js b/test/integration/index.js index 5c5e371c4..6a159161c 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -43,7 +43,7 @@ const MAX_API_TIME = 1000 * 90 const MAX_FILE_TIME = 1000 * 30 const MAX_TEST_TIME = 1000 * 3 -const ossSkips = { +const freeSkips = { // TODO: remove this once 'arbitrary_key' is implemented // https://github.com/elastic/elasticsearch/pull/41492 'indices.split/30_copy_settings.yml': ['*'], @@ -57,7 +57,7 @@ const ossSkips = { // while null is a valid json value, so the check will fail 'search/320_disallow_queries.yml': ['Test disallow expensive queries'] } -const xPackBlackList = { +const platinumBlackList = { // this two test cases are broken, we should // return on those in the future. 'analytics/top_metrics.yml': [ @@ -161,9 +161,9 @@ async function start ({ client, isXPack }) { log(`Checking out sha ${sha}...`) await withSHA(sha) - log(`Testing ${isXPack ? 'XPack' : 'oss'} api...`) + log(`Testing ${isXPack ? 'Platinum' : 'Free'} api...`) const junit = createJunitReporter() - const junitTestSuites = junit.testsuites(`Integration test for ${isXPack ? 'XPack' : 'oss'} api`) + const junitTestSuites = junit.testsuites(`Integration test for ${isXPack ? 'Platinum' : 'Free'} api`) const stats = { total: 0, @@ -254,7 +254,7 @@ async function start ({ client, isXPack }) { junitTestCase.end() junitTestSuite.end() junitTestSuites.end() - generateJunitXmlReport(junit, isXPack ? 'xpack' : 'oss') + generateJunitXmlReport(junit, isXPack ? 'platinum' : 'free') console.error(err) process.exit(1) } @@ -282,7 +282,7 @@ async function start ({ client, isXPack }) { } } junitTestSuites.end() - generateJunitXmlReport(junit, isXPack ? 'xpack' : 'oss') + generateJunitXmlReport(junit, isXPack ? 'platinum' : 'free') log(`Total testing time: ${ms(now() - totalTime)}`) log(`Test stats: - Total: ${stats.total} @@ -425,26 +425,26 @@ if (require.main === module) { } const shouldSkip = (isXPack, file, name) => { - var list = Object.keys(ossSkips) + var list = Object.keys(freeSkips) for (var i = 0; i < list.length; i++) { - const ossTest = ossSkips[list[i]] - for (var j = 0; j < ossTest.length; j++) { - if (file.endsWith(list[i]) && (name === ossTest[j] || ossTest[j] === '*')) { + const freeTest = freeSkips[list[i]] + for (var j = 0; j < freeTest.length; j++) { + if (file.endsWith(list[i]) && (name === freeTest[j] || freeTest[j] === '*')) { const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name - log(`Skipping test ${testName} because is blacklisted in the oss test`) + log(`Skipping test ${testName} because is blacklisted in the free test`) return true } } } if (file.includes('x-pack') || isXPack) { - list = Object.keys(xPackBlackList) + list = Object.keys(platinumBlackList) for (i = 0; i < list.length; i++) { - const platTest = xPackBlackList[list[i]] + const platTest = platinumBlackList[list[i]] for (j = 0; j < platTest.length; j++) { if (file.endsWith(list[i]) && (name === platTest[j] || platTest[j] === '*')) { const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name - log(`Skipping test ${testName} because is blacklisted in the XPack test`) + log(`Skipping test ${testName} because is blacklisted in the platinum test`) return true } } From 228dd711f56c547c4605b937d183f3ec3043a7ca Mon Sep 17 00:00:00 2001 From: delvedor Date: Mon, 8 Feb 2021 18:52:34 +0100 Subject: [PATCH 2/3] Updated skip list --- test/integration/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/index.js b/test/integration/index.js index 6a159161c..161037f34 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -88,6 +88,7 @@ const platinumBlackList = { 'monitoring/bulk/20_privileges.yml': ['*'], 'license/20_put_license.yml': ['*'], 'snapshot/10_basic.yml': ['*'], + 'snapshot/20_operator_privileges_disabled.yml': ['*'], // the body is correct, but the regex is failing 'sql/sql.yml': ['Getting textual representation'], // we are setting two certificates in the docker config From c9209168aae8b8235d07a84d13c9f32d9eafd0f8 Mon Sep 17 00:00:00 2001 From: delvedor Date: Mon, 8 Feb 2021 19:40:26 +0100 Subject: [PATCH 3/3] Updated skip list --- test/integration/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/index.js b/test/integration/index.js index 161037f34..c4f756dab 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -68,6 +68,7 @@ const platinumBlackList = { 'index/10_with_id.yml': ['Index with ID'], 'indices.get_alias/10_basic.yml': ['Get alias against closed indices'], 'indices.get_alias/20_empty.yml': ['Check empty aliases when getting all aliases via /_alias'], + 'text_structure/find_structure.yml': ['*'], // https://github.com/elastic/elasticsearch/pull/39400 'ml/jobs_crud.yml': ['Test put job with id that is already taken'], // object keys must me strings, and `0.0.toString()` is `0`