From 2d7b217d95326fdbf8ffb3fbc73efae02bd94ac9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 2 Oct 2015 12:45:33 -0700 Subject: [PATCH 1/3] linter runs after tests via jake --- Jakefile.js | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 943f2eff5ec4a..dcee5f7ef53f1 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -655,7 +655,14 @@ task("runtests", ["tests", builtLocalDirectory], function() { // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer var cmd = host + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run; console.log(cmd); - exec(cmd, deleteTemporaryProjectOutput); + exec(cmd, function() { + deleteTemporaryProjectOutput(); + var lint = jake.Task['lint']; + lint.addListener('complete', function () { + complete(); + }); + lint.invoke(); + }); }, {async: true}); desc("Generates code coverage data via instanbul"); diff --git a/package.json b/package.json index 607a38552bad1..28f2c1b575549 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "scripts": { "pretest": "jake tests", - "test": "jake runtests && npm run lint", + "test": "jake runtests", "build": "npm run build:compiler && npm run build:tests", "build:compiler": "jake local", "build:tests": "jake tests", From da09f35acab63d9e4df543de53c574bf4224b8a6 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 2 Oct 2015 16:21:20 -0700 Subject: [PATCH 2/3] Jake hates deps --- Jakefile.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index dcee5f7ef53f1..4c13aba3821f6 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -628,10 +628,9 @@ function deleteTemporaryProjectOutput() { var testTimeout = 20000; desc("Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]', debug=true."); -task("runtests", ["tests", builtLocalDirectory], function() { +task("runtests", ["build-rules", "tests", builtLocalDirectory], function() { cleanTestDirs(); var debug = process.env.debug || process.env.d; - host = "mocha" tests = process.env.test || process.env.tests || process.env.t; var light = process.env.light || false; var testConfigFile = 'test.config'; @@ -653,7 +652,7 @@ task("runtests", ["tests", builtLocalDirectory], function() { reporter = process.env.reporter || process.env.r || 'mocha-fivemat-progress-reporter'; // timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer - var cmd = host + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run; + var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run; console.log(cmd); exec(cmd, function() { deleteTemporaryProjectOutput(); @@ -833,7 +832,7 @@ var tslintRulesOutFiles = tslintRules.map(function(p) { desc("Compiles tslint rules to js"); task("build-rules", tslintRulesOutFiles); tslintRulesFiles.forEach(function(ruleFile, i) { - compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ true, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint")); + compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint")); }); function getLinterOptions() { From ba2024f493b50fc562653eeaf0004f7ac6554d55 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 2 Oct 2015 17:04:44 -0700 Subject: [PATCH 3/3] Remove obsoleted comment --- Jakefile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 4c13aba3821f6..fcebeb1771608 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -866,8 +866,6 @@ function lintFileAsync(options, path, cb) { var lintTargets = compilerSources.concat(harnessCoreSources); -// if the codebase were free of linter errors we could make jake runtests -// run this task automatically desc("Runs tslint on the compiler sources"); task("lint", ["build-rules"], function() { var lintOptions = getLinterOptions();