diff --git a/bin/ncu-ci b/bin/ncu-ci index 098f3c4b..5de4ee92 100755 --- a/bin/ncu-ci +++ b/bin/ncu-ci @@ -6,12 +6,12 @@ const { JobParser, parseJobFromURL, CI_TYPES_KEYS: { - PR, COMMIT, BENCHMARK + PR, COMMIT, COMMIT_V8, BENCHMARK } } = require('../lib/ci/ci_type_parser'); const { - PRBuild, BenchmarkRun, CommitBuild, HealthBuild, + PRBuild, BenchmarkRun, CommitBuild, CommitV8Build, HealthBuild, listBuilds, FailureAggregator, jobCache } = require('../lib/ci/ci_result_parser'); const clipboardy = require('clipboardy'); @@ -98,6 +98,18 @@ const argv = yargs }, handler }) + .command({ + command: 'commit-v8 ', + desc: 'Show results of a node-test-commit-v8-linux CI job', + builder: (yargs) => { + yargs + .positional('jobid', { + describe: 'id of the job', + type: 'number' + }); + }, + handler + }) .command({ command: 'benchmark ', desc: 'Show results of a benchmark-node-micro-benchmarks CI job', @@ -128,6 +140,7 @@ const argv = yargs const commandToType = { commit: COMMIT, + 'commit-v8': COMMIT_V8, pr: PR, benchmark: BENCHMARK }; @@ -173,6 +186,9 @@ class CICommand { case COMMIT: build = new CommitBuild(cli, request, job.jobid); break; + case COMMIT_V8: + build = new CommitV8Build(cli, request, job.jobid); + break; case BENCHMARK: build = new BenchmarkRun(cli, request, job.jobid); break; @@ -342,6 +358,7 @@ async function main(command, argv) { } case 'pr': case 'commit': + case 'commit-v8': case 'benchmark': { commandHandler = new JobCommand(cli, request, argv, command); break; diff --git a/lib/ci/ci_failure_parser.js b/lib/ci/ci_failure_parser.js index 8a91d935..695d226f 100644 --- a/lib/ci/ci_failure_parser.js +++ b/lib/ci/ci_failure_parser.js @@ -28,6 +28,7 @@ function pickContext(matches, text, { } const BUILD_FAILURE = 'BUILD_FAILURE'; +const SETUP_FAILURE = 'SETUP_FAILURE'; const JS_TEST_FAILURE = 'JS_TEST_FAILURE'; const CC_TEST_FAILURE = 'CC_TEST_FAILURE'; const JENKINS_FAILURE = 'JENKINS_FAILURE'; @@ -60,6 +61,13 @@ class BuildFailure extends CIResult { } } +class SetupFailure extends CIResult { + constructor(ctx, reason) { + super(ctx, reason); + this.type = SETUP_FAILURE; + } +} + // Usually needs a fix in the test or the core class JSTestFailure extends CIResult { constructor(ctx, reason) { @@ -141,6 +149,24 @@ const FAILURE_FILTERS = [{ match => new JSTestFailure(ctx, match) ); } +}, { + // gclient sync failed to fetch something from upstream + filter(ctx, text) { + const patterns = [{ + pattern: /Failed to fetch file.+/g, + context: { index: 0, contextBefore: 0, contextAfter: 0 } + }]; + return failureMatcher(SetupFailure, patterns, ctx, text); + } +}, { + // V8 cctests + filter(ctx, text) { + const patterns = [{ + pattern: /=== cctest\/[\S]+ ===[\s\S]+?Command: .*\r?\n/g, + context: { index: 0, contextBefore: 0, contextAfter: 0 } + }]; + return failureMatcher(CCTestFailure, patterns, ctx, text); + } }, { filter(ctx, text) { const patterns = [{ diff --git a/lib/ci/ci_result_parser.js b/lib/ci/ci_result_parser.js index b8eb34f2..783912fd 100644 --- a/lib/ci/ci_result_parser.js +++ b/lib/ci/ci_result_parser.js @@ -63,6 +63,28 @@ function getPath(url) { return url.replace(`https://${CI_DOMAIN}/`, '').replace('api/json', ''); } +function displayFailure(cli, failure) { + const { url, reason } = failure; + cli.separator(getNodeName(url)); + cli.table('URL', url); + if (failure.type) { + cli.table('Type', failure.type); + } + if (failure.builtOn) { + cli.table('Built On', failure.builtOn); + } + if (!reason.includes('\n') && reason.length < 40) { + cli.table('Reason', chalk.red(reason)); + } else { + cli.table('Reason', ''); + const lines = reason.split('\n'); + cli.log(` ${chalk.red(lines[0])}`); + for (let i = 1; i < lines.length; ++i) { + cli.log(` ${lines[i]}`); + } + } +} + function getUrl(path) { return `https://${CI_DOMAIN}/${getPath(path)}`; } @@ -270,25 +292,7 @@ class TestBuild extends Job { displayFailure(failure) { const { cli } = this; - const { url, reason } = failure; - cli.separator(getNodeName(url)); - cli.table('URL', url); - if (failure.type) { - cli.table('Type', failure.type); - } - if (failure.builtOn) { - cli.table('Built On', failure.builtOn); - } - if (!reason.includes('\n') && reason.length < 40) { - cli.table('Reason', chalk.red(reason)); - } else { - cli.table('Reason', ''); - const lines = reason.split('\n'); - cli.log(` ${chalk.red(lines[0])}`); - for (let i = 1; i < lines.length; ++i) { - cli.log(` ${lines[i]}`); - } - } + displayFailure(cli, failure); } displayBuilds() { @@ -917,6 +921,18 @@ class NormalBuild extends Job { } } +class CommitV8Build extends NormalBuild { + constructor(cli, request, id) { + super(cli, request, 'node-test-commit-v8-linux', id); + } + + display() { + for (const failure of this.failures) { + displayFailure(this.cli, failure); + } + } +} + class TestRun extends Job { constructor(cli, request, url) { const path = getPath(url); @@ -1022,6 +1038,7 @@ module.exports = { PRBuild, BenchmarkRun, CommitBuild, + CommitV8Build, HealthBuild, jobCache, parseJobFromURL,