This commit is contained in:
Tomas Della Vedova
2021-02-09 08:13:42 +01:00
committed by delvedor
parent db65adcd39
commit 69953cf9a1
2 changed files with 24 additions and 16 deletions

View File

@ -2,7 +2,7 @@
# parameters are available to this script # parameters are available to this script
# STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease) # 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 # 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) # NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here)
script_path=$(dirname $(realpath -s $0)) script_path=$(dirname $(realpath -s $0))

View File

@ -43,9 +43,10 @@ const MAX_API_TIME = 1000 * 90
const MAX_FILE_TIME = 1000 * 30 const MAX_FILE_TIME = 1000 * 30
const MAX_TEST_TIME = 1000 * 3 const MAX_TEST_TIME = 1000 * 3
const ossSkips = { const freeSkips = {
'cat.indices/10_basic.yml': ['Test cat indices output for closed index (pre 7.2.0)'], 'cat.indices/10_basic.yml': ['Test cat indices output for closed index (pre 7.2.0)'],
'cluster.health/10_basic.yml': ['cluster health with closed index (pre 7.2.0)'], 'cluster.health/10_basic.yml': ['cluster health with closed index (pre 7.2.0)'],
// TODO: remove this once 'arbitrary_key' is implemented // TODO: remove this once 'arbitrary_key' is implemented
// https://github.com/elastic/elasticsearch/pull/41492 // https://github.com/elastic/elasticsearch/pull/41492
'indices.split/30_copy_settings.yml': ['*'], 'indices.split/30_copy_settings.yml': ['*'],
@ -56,12 +57,18 @@ const ossSkips = {
// which triggers a retry and the node to be marked as dead // which triggers a retry and the node to be marked as dead
'search.aggregation/240_max_buckets.yml': ['*'] 'search.aggregation/240_max_buckets.yml': ['*']
} }
const xPackBlackList = { const platinumBlackList = {
// file path: test name // this two test cases are broken, we should
// return on those in the future.
'analytics/top_metrics.yml': [
'sort by keyword field fails',
'sort by string script fails'
],
'cat.aliases/10_basic.yml': ['Empty cluster'], 'cat.aliases/10_basic.yml': ['Empty cluster'],
'index/10_with_id.yml': ['Index with ID'], 'index/10_with_id.yml': ['Index with ID'],
'indices.get_alias/10_basic.yml': ['Get alias against closed indices'], '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'], '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 // https://github.com/elastic/elasticsearch/pull/39400
'ml/jobs_crud.yml': ['Test put job with id that is already taken'], 'ml/jobs_crud.yml': ['Test put job with id that is already taken'],
// object keys must me strings, and `0.0.toString()` is `0` // object keys must me strings, and `0.0.toString()` is `0`
@ -82,6 +89,7 @@ const xPackBlackList = {
'monitoring/bulk/20_privileges.yml': ['*'], 'monitoring/bulk/20_privileges.yml': ['*'],
'license/20_put_license.yml': ['*'], 'license/20_put_license.yml': ['*'],
'snapshot/10_basic.yml': ['*'], 'snapshot/10_basic.yml': ['*'],
'snapshot/20_operator_privileges_disabled.yml': ['*'],
// the body is correct, but the regex is failing // the body is correct, but the regex is failing
'sql/sql.yml': ['Getting textual representation'], 'sql/sql.yml': ['Getting textual representation'],
// we are setting two certificates in the docker config // we are setting two certificates in the docker config
@ -155,9 +163,9 @@ async function start ({ client, isXPack }) {
log(`Checking out sha ${sha}...`) log(`Checking out sha ${sha}...`)
await withSHA(sha) await withSHA(sha)
log(`Testing ${isXPack ? 'XPack' : 'oss'} api...`) log(`Testing ${isXPack ? 'Platinum' : 'Free'} api...`)
const junit = createJunitReporter() 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 = { const stats = {
total: 0, total: 0,
@ -248,7 +256,7 @@ async function start ({ client, isXPack }) {
junitTestCase.end() junitTestCase.end()
junitTestSuite.end() junitTestSuite.end()
junitTestSuites.end() junitTestSuites.end()
generateJunitXmlReport(junit, isXPack ? 'xpack' : 'oss') generateJunitXmlReport(junit, isXPack ? 'platinum' : 'free')
console.error(err) console.error(err)
process.exit(1) process.exit(1)
} }
@ -276,7 +284,7 @@ async function start ({ client, isXPack }) {
} }
} }
junitTestSuites.end() junitTestSuites.end()
generateJunitXmlReport(junit, isXPack ? 'xpack' : 'oss') generateJunitXmlReport(junit, isXPack ? 'platinum' : 'free')
log(`Total testing time: ${ms(now() - totalTime)}`) log(`Total testing time: ${ms(now() - totalTime)}`)
log(`Test stats: log(`Test stats:
- Total: ${stats.total} - Total: ${stats.total}
@ -419,26 +427,26 @@ if (require.main === module) {
} }
const shouldSkip = (isXPack, file, name) => { const shouldSkip = (isXPack, file, name) => {
var list = Object.keys(ossSkips) var list = Object.keys(freeSkips)
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
const ossTest = ossSkips[list[i]] const freeTest = freeSkips[list[i]]
for (var j = 0; j < ossTest.length; j++) { for (var j = 0; j < freeTest.length; j++) {
if (file.endsWith(list[i]) && (name === ossTest[j] || ossTest[j] === '*')) { if (file.endsWith(list[i]) && (name === freeTest[j] || freeTest[j] === '*')) {
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name 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 return true
} }
} }
} }
if (file.includes('x-pack') || isXPack) { if (file.includes('x-pack') || isXPack) {
list = Object.keys(xPackBlackList) list = Object.keys(platinumBlackList)
for (i = 0; i < list.length; i++) { for (i = 0; i < list.length; i++) {
const platTest = xPackBlackList[list[i]] const platTest = platinumBlackList[list[i]]
for (j = 0; j < platTest.length; j++) { for (j = 0; j < platTest.length; j++) {
if (file.endsWith(list[i]) && (name === platTest[j] || platTest[j] === '*')) { if (file.endsWith(list[i]) && (name === platTest[j] || platTest[j] === '*')) {
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name 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 return true
} }
} }