[failure-reporting] ignore a couple other failure types (#39000)

This commit is contained in:
Spencer 2019-06-17 13:52:28 -07:00 committed by GitHub
parent c47a0d5cdf
commit eb4308d464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 91 additions and 1 deletions

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite timestamp="2019-06-13T23:29:36" time="30.739" tests="1444" failures="2" skipped="3">
<testcase name="code in multiple nodes &quot;before all&quot; hook" classname="X-Pack Mocha Tests.x-pack/plugins/code/server/__tests__/multi_node·ts" time="0.121">
<system-out>
<![CDATA[]]>
</system-out>
<failure>
<![CDATA[Error: Unable to read artifact info from https://artifacts-api.elastic.co/v1/versions/8.0.0-SNAPSHOT/builds/latest/projects/elasticsearch: Service Temporarily Unavailable
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor="white">
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx/1.13.7</center>
</body>
</html>
at Function.getSnapshot (/var/lib/jenkins/workspace/elastic+kibana+master/JOB/x-pack-intake/node/immutable/kibana/packages/kbn-es/src/artifact.js:95:13)
at process._tickCallback (internal/process/next_tick.js:68:7)]]>
</failure>
</testcase>
<testcase name="code in multiple nodes &quot;after all&quot; hook" classname="X-Pack Mocha Tests.x-pack/plugins/code/server/__tests__/multi_node·ts" time="0.003">
<system-out>
<![CDATA[]]>
</system-out>
<failure>
<![CDATA[TypeError: Cannot read property 'shutdown' of undefined
at Context.shutdown (plugins/code/server/__tests__/multi_node.ts:125:23)
at process.topLevelDomainCallback (domain.js:120:23)]]>
</failure>
</testcase>
<testcase name="repository service test can not clone a repo by ssh without a key" classname="X-Pack Mocha Tests.x-pack/plugins/code/server/__tests__/repository_service·ts" time="0.005">
<system-out>
<![CDATA[]]>
</system-out>
</testcase>
</testsuite>
</testsuites>

View file

@ -33,7 +33,7 @@ const indent = text => (
` ${text.split('\n').map(l => ` ${l}`).join('\n')}`
);
const isLikelyIrrelevant = ({ failure }) => {
const isLikelyIrrelevant = ({ name, failure }) => {
if (failure.includes('NoSuchSessionError: This driver instance does not have a valid session ID')) {
return true;
}
@ -42,6 +42,14 @@ const isLikelyIrrelevant = ({ failure }) => {
return true;
}
if (name.includes('"after all" hook') && failure.includes(`Cannot read property 'shutdown' of undefined`)) {
return true;
}
if (failure.includes('Unable to read artifact info') && failure.includes('Service Temporarily Unavailable')) {
return true;
}
if (failure.includes('Unable to fetch Kibana status API response from Kibana')) {
return true;
}

View file

@ -107,4 +107,48 @@ Wait timed out after 10055ms
`);
});
});
describe('mocha report', () => {
it('allows relevant tests', async () => {
const failures = await createPromiseFromStreams([
vfs.src([resolve(__dirname, '__fixtures__/mocha_report.xml')]),
mapXml(),
filterFailures(),
createConcatStream(),
]);
expect(console.log.mock.calls).toMatchInlineSnapshot(`
Array [
Array [
"Ignoring likely irrelevant failure: X-Pack Mocha Tests.x-pack/plugins/code/server/__tests__/multi_node·ts - code in multiple nodes \\"before all\\" hook
Error: Unable to read artifact info from https://artifacts-api.elastic.co/v1/versions/8.0.0-SNAPSHOT/builds/latest/projects/elasticsearch: Service Temporarily Unavailable
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor=\\"white\\">
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx/1.13.7</center>
</body>
</html>
at Function.getSnapshot (/var/lib/jenkins/workspace/elastic+kibana+master/JOB/x-pack-intake/node/immutable/kibana/packages/kbn-es/src/artifact.js:95:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
",
],
Array [
"Ignoring likely irrelevant failure: X-Pack Mocha Tests.x-pack/plugins/code/server/__tests__/multi_node·ts - code in multiple nodes \\"after all\\" hook
TypeError: Cannot read property 'shutdown' of undefined
at Context.shutdown (plugins/code/server/__tests__/multi_node.ts:125:23)
at process.topLevelDomainCallback (domain.js:120:23)
",
],
Array [
"Found 0 test failures",
],
]
`);
expect(failures).toMatchInlineSnapshot(`Array []`);
});
});
});