File tree Expand file tree Collapse file tree 4 files changed +39
-3
lines changed Expand file tree Collapse file tree 4 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const {
1919
2020const CIParser = require ( './ci' ) ;
2121const CI_TYPES = CIParser . TYPES ;
22- const { FULL } = CIParser . constants ;
22+ const { FULL , LITE } = CIParser . constants ;
2323
2424class PRChecker {
2525 /**
@@ -203,9 +203,9 @@ class PRChecker {
203203 cli . error ( 'No CI runs detected' ) ;
204204 this . CIStatus = false ;
205205 return false ;
206- } else if ( ! ciMap . get ( FULL ) ) {
206+ } else if ( ! ciMap . get ( FULL ) && ! ciMap . get ( LITE ) ) {
207207 status = false ;
208- cli . error ( 'No full CI runs detected' ) ;
208+ cli . error ( 'No full CI runs or lite CI runs detected' ) ;
209209 }
210210
211211 let lastCI ;
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "publishedAt" : " 2018-02-09T21:38:30Z" ,
4+ "bodyText" : " CI: https://ci.nodejs.org/job/node-test-commit-lite/246/"
5+ }
6+ ]
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const requestedChangesReviewers = {
2323const approvingReviews = readJSON ( 'reviews_approved.json' ) ;
2424const requestingChangesReviews = readJSON ( 'reviews_requesting_changes.json' ) ;
2525
26+ const commentsWithLiteCI = readJSON ( 'comments_with_lite_ci.json' ) ;
2627const commentsWithCI = readJSON ( 'comments_with_ci.json' ) ;
2728const commentsWithLGTM = readJSON ( 'comments_with_lgtm.json' ) ;
2829
@@ -79,6 +80,7 @@ module.exports = {
7980 approvingReviews,
8081 requestingChangesReviews,
8182 commentsWithCI,
83+ commentsWithLiteCI,
8284 commentsWithLGTM,
8385 oddCommits,
8486 incorrectGitConfigCommits,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const {
1313 approvingReviews,
1414 requestingChangesReviews,
1515 commentsWithCI,
16+ commentsWithLiteCI,
1617 commentsWithLGTM,
1718 singleCommitAfterReview,
1819 multipleCommitsAfterReview,
@@ -548,6 +549,33 @@ describe('PRChecker', () => {
548549 assert ( ! status ) ;
549550 cli . assertCalledWith ( expectedLogs ) ;
550551 } ) ;
552+
553+ it ( 'should count LITE CI as valid ci requirement' , ( ) => {
554+ const cli = new TestCLI ( ) ;
555+
556+ const expectedLogs = {
557+ info : [
558+ [
559+ 'Last Lite CI on 2018-02-09T21:38:30Z: ' +
560+ 'https://ci.nodejs.org/job/node-test-commit-lite/246/'
561+ ]
562+ ]
563+ } ;
564+
565+ const checker = new PRChecker ( cli , {
566+ pr : firstTimerPR ,
567+ reviewers : allGreenReviewers ,
568+ comments : commentsWithLiteCI ,
569+ reviews : approvingReviews ,
570+ commits : [ ] ,
571+ collaborators,
572+ authorIsNew : ( ) => true
573+ } , { maxCommits : 0 } ) ;
574+
575+ const status = checker . checkCI ( ) ;
576+ assert ( status ) ;
577+ cli . assertCalledWith ( expectedLogs ) ;
578+ } ) ;
551579 } ) ;
552580
553581 describe ( 'checkAuthor' , ( ) => {
You can’t perform that action at this time.
0 commit comments