improve fuzzing on Travis CI

This commit is contained in:
alexlamsl
2018-07-13 02:05:52 +08:00
parent bcebacbb9e
commit 34a0ab6f2c

View File

@@ -15,6 +15,7 @@ if (process.argv[2] == "run") {
var branch = process.argv[3] || "v" + require("../package.json").version; var branch = process.argv[3] || "v" + require("../package.json").version;
var repository = encodeURIComponent(process.argv[4] || "mishoo/UglifyJS2"); var repository = encodeURIComponent(process.argv[4] || "mishoo/UglifyJS2");
var concurrency = process.argv[5] || 1; var concurrency = process.argv[5] || 1;
var platform = process.argv[6] || "node/latest";
(function request() { (function request() {
setTimeout(request, (period + wait) / concurrency); setTimeout(request, (period + wait) / concurrency);
var options = url.parse("https://api.travis-ci.org/repo/" + repository + "/requests"); var options = url.parse("https://api.travis-ci.org/repo/" + repository + "/requests");
@@ -32,20 +33,18 @@ if (process.argv[2] == "run") {
res.on("data", console.log); res.on("data", console.log);
}).on("error", console.error).end(JSON.stringify({ }).on("error", console.error).end(JSON.stringify({
request: { request: {
message: "ufuzz testing (when idle)", message: "ufuzz testing",
branch: branch, branch: branch,
config: { config: {
merge_mode: "replace", cache: false,
language: "node_js", env: "NODEJS_VER=" + platform,
node_js: "9",
sudo: false,
script: "node test/travis-ufuzz run" script: "node test/travis-ufuzz run"
} }
} }
})); }));
})(); })();
} else { } else {
console.log("Usage: test/travis-ufuzz.js <token> [branch] [repository] [concurrency]"); console.log("Usage: test/travis-ufuzz.js <token> [branch] [repository] [concurrency] [platform]");
} }
function spawn(endTime) { function spawn(endTime) {