Skip to content

Commit 6999876

Browse files
richardlaujoyeecheung
authored andcommitted
pr_checker: fix discovery of most recent CI (#334)
1 parent 873b22e commit 6999876

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/pr_checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class PRChecker {
201201
for (const [type, ci] of ciMap) {
202202
const name = CI_TYPES.get(type).name;
203203
cli.info(`Last ${name} CI on ${ci.date}: ${ci.link}`);
204-
if (!lastCI || lastCI.date > ci.date) {
204+
if (!lastCI || lastCI.date < ci.date) {
205205
lastCI = {
206206
typeName: name,
207207
date: ci.date

test/fixtures/commits_after_ci.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
"comment": [{
4040
"bodyText": "CI: https://ci.nodejs.org/job/node-test-pull-request/10984/",
4141
"publishedAt": "2017-10-24T11:19:25Z"
42+
},{
43+
"bodyText": "Lite-CI: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/10984/pipeline",
44+
"publishedAt": "2017-10-22T11:19:25Z"
4245
}]
4346
}

test/unit/pr_checker.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ describe('PRChecker', () => {
561561
['- feat: add something']
562562
],
563563
info: [
564+
['Last Lite PR Pipeline CI on 2017-10-22T11:19:25Z: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/10984/pipeline'],
564565
['Last Full PR CI on 2017-10-24T11:19:25Z: https://ci.nodejs.org/job/node-test-pull-request/10984/']
565566
]
566567
};

0 commit comments

Comments
 (0)