Skip to content

Commit

Permalink
ci-parser: add LITE category and detect node-test-commit-lite
Browse files Browse the repository at this point in the history
Fixes: #170
  • Loading branch information
priyank-p authored Mar 11, 2018
1 parent 8184d92 commit bccf30c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ const LIBUV = 'LIBUV';
const NOINTL = 'NOINTL';
const V8 = 'V8';
const LINTER = 'LINTER';
const LITE = 'LITE';

const CI_TYPES = new Map([
[CITGM, { name: 'CITGM', re: /citgm/ }],
[FULL,
{ name: 'Full',
re: /node-test-pull-request|node-test-commit\// }],
re: /node-test-pull-request\/|node-test-commit\// }],
[BENCHMARK, { name: 'Benchmark', re: /benchmark/ }],
[LIBUV, { name: 'libuv', re: /libuv/ }],
[NOINTL, { name: 'No Intl', re: /nointl/ }],
[V8, { name: 'V8', re: /node-test-commit-v8/ }],
[LINTER, { name: 'Linter', re: /node-test-linter/ }]
[LINTER, { name: 'Linter', re: /node-test-linter/ }],
[LITE, { name: 'Lite', re: /node-test-.+-lite/ }]
]);

class CIParser {
Expand Down Expand Up @@ -78,7 +80,7 @@ class CIParser {

CIParser.TYPES = CI_TYPES;
CIParser.constants = {
CITGM, FULL, BENCHMARK, LIBUV, V8, NOINTL, LINTER
CITGM, FULL, BENCHMARK, LIBUV, V8, NOINTL, LINTER, LITE
};

module.exports = CIParser;
3 changes: 3 additions & 0 deletions test/fixtures/comments_with_ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
{
"publishedAt": "2017-10-22T04:16:36.458Z",
"bodyText": "Linter CI: https://ci.nodejs.org/job/node-test-linter/13127/"
},{
"publishedAt": "2018-02-09T21:38:30Z",
"bodyText": "CI https://ci.nodejs.org/job/node-test-commit-lite/246/"
}
]
4 changes: 4 additions & 0 deletions test/unit/ci.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const expected = new Map([
['LINTER', {
link: 'https://ci.nodejs.org/job/node-test-linter/13127/',
date: '2017-10-22T04:16:36.458Z'
}],
['LITE', {
link: 'https://ci.nodejs.org/job/node-test-commit-lite/246/',
date: '2018-02-09T21:38:30Z'
}]
]);

Expand Down
4 changes: 4 additions & 0 deletions test/unit/pr_checker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ describe('PRChecker', () => {
[
'Last Linter CI on 2017-10-22T04:16:36.458Z: ' +
'https://ci.nodejs.org/job/node-test-linter/13127/'
],
[
'Last Lite CI on 2018-02-09T21:38:30Z: ' +
'https://ci.nodejs.org/job/node-test-commit-lite/246/'
]
]
};
Expand Down

0 comments on commit bccf30c

Please sign in to comment.