Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Fail tests if CIRCLE_NODE_TOTAL is < 4 (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchen63 authored Jan 21, 2017
1 parent d651145 commit 8fbcf3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ general:
- gh-pages
dependencies:
pre:
- node ./scripts/assertMinCircleNodes.js $CIRCLE_NODE_TOTAL
- case $CIRCLE_NODE_INDEX in 0) nvm use 4.2 ;; 1) nvm use 5.7 ;; [2-3]) nvm use 6.1 ;; esac
test:
override:
Expand Down
8 changes: 8 additions & 0 deletions scripts/assertMinCircleNodes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var requiredNodes = 4;
var nodes = parseInt(process.argv[2], 10);
if (requiredNodes != null && requiredNodes > nodes) {
console.error("ERROR: You must run CircleCI with 4 parallel nodes");
console.error(" This ensures that different environments are tested for TSLint compatibility");
console.error(" https://circleci.com/gh/<YOUR ACCOUNT>/tslint/edit#parallel-builds");
process.exit(1);
}

0 comments on commit 8fbcf3e

Please sign in to comment.