Skip to content

Commit c084039

Browse files
committed
chore(build): faster feedback for broken lint
Originally we ran gulp enforce-format at the beginning of the build. This was annoying because you came back from lunch to find that no tests ran so you have to start your PR over. Then we changed it to run the linters at the end. This is annoying because you might be ready to merge to master, and could have fixed the lint issues immediately, but now much wait for another PR. The solution is to run the lint checks in another build. This marks your PR red very early, but you still get the feedback of whether the tests are passing.
1 parent 4893002 commit c084039

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ env:
3030
# GITHUB_TOKEN_ANGULAR
3131
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
3232
matrix:
33-
# Make slowest build on top, so that we don't hog VMs while waiting for others to complete.
33+
# Order: slowest build on top, so that we don't hog VMs while waiting for others to complete.
3434
- MODE=dart DART_CHANNEL=stable
3535
- MODE=dart DART_CHANNEL=dev
36+
# Disabled until we can make it pass.
37+
# - MODE=saucelabs DART_CHANNEL=dev
3638
- MODE=dart_experimental DART_CHANNEL=dev
3739
- MODE=js DART_CHANNEL=dev
38-
# Dissabled until we can make it pass.
39-
# - MODE=saucelabs DART_CHANNEL=dev
40+
- MODE=lint DART_CHANNEL=dev
4041

4142
matrix:
4243
allow_failures:

gulpfile.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ function getBrowsersFromCLI() {
556556
return {
557557
browsersToRun: outputList.filter(function(item, pos, self) {return self.indexOf(item) == pos;}),
558558
isSauce: isSauce
559-
}
559+
};
560560
}
561561

562562
gulp.task('test.unit.js', ['build.js.dev'], function (done) {
@@ -574,8 +574,13 @@ gulp.task('test.unit.js', ['build.js.dev'], function (done) {
574574
gulp.task('test.unit.js.sauce', ['build.js.dev'], function (done) {
575575
var browserConf = getBrowsersFromCLI();
576576
if (browserConf.isSauce) {
577-
karma.server.start({configFile: __dirname + '/karma-js.conf.js',
578-
singleRun: true, browserNoActivityTimeout: 240000, captureTimeout: 120000, reporters: ['dots'], browsers: browserConf.browsersToRun},
577+
karma.server.start({
578+
configFile: __dirname + '/karma-js.conf.js',
579+
singleRun: true,
580+
browserNoActivityTimeout: 240000,
581+
captureTimeout: 120000,
582+
reporters: ['dots'],
583+
browsers: browserConf.browsersToRun},
579584
function(err) {done(); process.exit(err ? 1 : 0)});
580585
} else {
581586
throw new Error('ERROR: no Saucelabs browsers provided, add them with the --browsers option');
@@ -727,14 +732,20 @@ gulp.task('test.transpiler.unittest', function(done) {
727732
});
728733

729734
// -----------------
730-
// Pre/Post-test checks
735+
// Pre-test checks
731736

732737
gulp.task('pre-test-checks', function(done) {
733738
runSequence('build/checkCircularDependencies', sequenceComplete(done));
734739
});
735740

736-
gulp.task('post-test-checks', function(done) {
737-
runSequence('lint', 'enforce-format', sequenceComplete(done));
741+
// -----------------
742+
// Checks which should fail the build, but should not block us running the tests.
743+
// This task is run in a separate travis worker, so these checks provide faster
744+
// feedback while allowing tests to execute.
745+
gulp.task('static-checks', ['!build.tools'], function(done) {
746+
runSequence(
747+
['enforce-format', 'lint', 'test.typings'],
748+
sequenceComplete(done));
738749
});
739750

740751

scripts/ci/build_and_test.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ echo ===========================================================================
88
SCRIPT_DIR=$(dirname $0)
99
cd $SCRIPT_DIR/../..
1010

11-
if [ "$MODE" = "dart_experimental" ]
12-
then
11+
if [ "$MODE" = "dart_experimental" ]; then
1312
${SCRIPT_DIR}/build_$MODE.sh
13+
elif [ "$MODE" = "saucelabs" ]; then
14+
${SCRIPT_DIR}/test_$MODE.sh
15+
elif [ "$MODE" = "lint" ]; then
16+
./node_modules/.bin/gulp static-checks
1417
else
15-
if [ "$MODE" = "saucelabs" ]
16-
then
17-
${SCRIPT_DIR}/test_$MODE.sh
18-
else
19-
${SCRIPT_DIR}/build_$MODE.sh
20-
mkdir deploy; tar -czpf deploy/dist.tgz -C dist .
21-
${SCRIPT_DIR}/test_$MODE.sh
22-
fi
18+
${SCRIPT_DIR}/build_$MODE.sh
19+
mkdir deploy; tar -czpf deploy/dist.tgz -C dist .
20+
${SCRIPT_DIR}/test_$MODE.sh
2321
fi

scripts/ci/test_js.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ fi
1515
./node_modules/.bin/gulp pre-test-checks
1616
./node_modules/.bin/gulp test.js --browsers=${KARMA_BROWSERS:-ChromeCanary}
1717
${SCRIPT_DIR}/test_e2e_js.sh
18-
./node_modules/.bin/gulp post-test-checks

0 commit comments

Comments
 (0)