Added integration test stats (#1083)

This commit is contained in:
Tomas Della Vedova
2020-02-06 12:04:55 +01:00
committed by delvedor
parent a91e5375ac
commit 874b04f819
2 changed files with 44 additions and 11 deletions

View File

@ -20,7 +20,7 @@ const xPackYamlFolder = join(esFolder, 'x-pack', 'plugin', 'src', 'test', 'resou
const MAX_API_TIME = 1000 * 90
const MAX_FILE_TIME = 1000 * 30
const MAX_TEST_TIME = 1000 * 2
const MAX_TEST_TIME = 1000 * 3
const ossSkips = {
'cat.indices/10_basic.yml': ['Test cat indices output for closed index (pre 7.2.0)'],
@ -111,6 +111,12 @@ async function start ({ client, isXPack }) {
log(`Testing ${isXPack ? 'XPack' : 'oss'} api...`)
const stats = {
total: 0,
skip: 0,
pass: 0,
assertions: 0
}
const folders = getAllFiles(isXPack ? xPackYamlFolder : yamlFolder)
.filter(t => !/(README|TODO)/g.test(t))
// we cluster the array based on the folder names,
@ -172,10 +178,15 @@ async function start ({ client, isXPack }) {
const testTime = now()
const name = Object.keys(test)[0]
if (name === 'setup' || name === 'teardown') continue
if (shouldSkip(isXPack, file, name)) continue
stats.total += 1
if (shouldSkip(isXPack, file, name)) {
stats.skip += 1
continue
}
log(' - ' + name)
try {
await testRunner.run(setupTest, test[name], teardownTest)
await testRunner.run(setupTest, test[name], teardownTest, stats)
stats.pass += 1
} catch (err) {
console.error(err)
process.exit(1)
@ -202,6 +213,12 @@ async function start ({ client, isXPack }) {
}
}
log(`Total testing time: ${ms(now() - totalTime)}`)
log(`Test stats:
- Total: ${stats.total}
- Skip: ${stats.skip}
- Pass: ${stats.pass}
- Assertions: ${stats.assertions}
`)
}
function log (text) {