[Pkg-javascript-commits] [uglifyjs] 91/228: only run benchmark & jetstream on CI (#1571)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository uglifyjs.

commit 3ee55748d466f36aff54383b53fb3deca144de97
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Wed Mar 8 06:00:51 2017 +0800

    only run benchmark & jetstream on CI (#1571)
---
 .travis.yml             |  5 ++++-
 test/mocha/benchmark.js | 24 ----------------------
 test/mocha/release.js   | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 25 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b91a80e..b2aef3d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,13 @@
 language: node_js
 before_install: "npm install -g npm"
 node_js:
-    - "0.12"
     - "0.10"
+    - "0.12"
     - "4"
     - "6"
+    - "7"
+env:
+    - UGLIFYJS_TEST_ALL=1
 matrix:
   fast_finish: true
 sudo: false
diff --git a/test/mocha/benchmark.js b/test/mocha/benchmark.js
deleted file mode 100644
index c2c7c02..0000000
--- a/test/mocha/benchmark.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var assert = require("assert");
-var exec = require("child_process").exec;
-
-describe("test/benchmark.js", function() {
-    this.timeout(120000);
-    var command = '"' + process.argv[0] + '" test/benchmark.js ';
-    [
-        "-b",
-        "-b bracketize",
-        "-m",
-        "-mc passes=3",
-        "-mc passes=3,toplevel",
-        "-mc passes=3,unsafe",
-        "-mc keep_fargs=false,passes=3",
-        "-mc keep_fargs=false,passes=3,pure_getters,unsafe,unsafe_comps,unsafe_math,unsafe_proto",
-    ].forEach(function(args) {
-        it("Should pass with options " + args, function(done) {
-            exec(command + args, function(err) {
-                if (err) throw err;
-                done();
-            });
-        });
-    });
-});
diff --git a/test/mocha/release.js b/test/mocha/release.js
new file mode 100644
index 0000000..3b2d9a7
--- /dev/null
+++ b/test/mocha/release.js
@@ -0,0 +1,54 @@
+var assert = require("assert");
+var spawn = require("child_process").spawn;
+
+if (!process.env.UGLIFYJS_TEST_ALL) return;
+
+function run(command, args, done) {
+    var id = setInterval(function() {
+        process.stdout.write("\0");
+    }, 5 * 60 * 1000);
+    spawn(command, args, {
+        stdio: "ignore"
+    }).on("exit", function(code) {
+        clearInterval(id);
+        assert.strictEqual(code, 0);
+        done();
+    });
+}
+
+describe("test/benchmark.js", function() {
+    this.timeout(5 * 60 * 1000);
+    [
+        "-b",
+        "-b bracketize",
+        "-m",
+        "-mc passes=3",
+        "-mc passes=3,toplevel",
+        "-mc passes=3,unsafe",
+        "-mc keep_fargs=false,passes=3",
+        "-mc keep_fargs=false,passes=3,pure_getters,unsafe,unsafe_comps,unsafe_math,unsafe_proto",
+    ].forEach(function(options) {
+        it("Should pass with options " + options, function(done) {
+            var args = options.split(/ /);
+            args.unshift("test/benchmark.js");
+            run(process.argv[0], args, done);
+        });
+    });
+});
+
+describe("test/jetstream.js", function() {
+    this.timeout(20 * 60 * 1000);
+    it("Should install phantomjs-prebuilt", function(done) {
+        run("npm", ["install", "phantomjs-prebuilt at 2.1.14"], done);
+    });
+    [
+        "-mc warnings=false",
+        "-mc keep_fargs=false,passes=3,pure_getters,unsafe,unsafe_comps,unsafe_math,unsafe_proto,warnings=false",
+    ].forEach(function(options) {
+        it("Should pass with options " + options, function(done) {
+            var args = options.split(/ /);
+            args.unshift("test/jetstream.js");
+            run(process.argv[0], args, done);
+        });
+    });
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list