Skip to content

Commit 62b30d0

Browse files
committed
Build: Also update the testswarm tasks itself
1 parent 0b3d689 commit 62b30d0

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

build/tasks/testswarm.js

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function( grunt ) {
44

55
var versions = {
66
"git": "git",
7+
"1.9": "1.9.0 1.9.1",
78
"1.8": "1.8.0 1.8.1 1.8.2 1.8.3",
89
"1.7": "1.7 1.7.1 1.7.2",
910
"1.6": "1.6 1.6.1 1.6.2 1.6.3 1.6.4"
@@ -34,29 +35,39 @@ var versions = {
3435
"Widget": "widget/widget.html"
3536
};
3637

37-
function submit( commit, tests, configFile, version, done ) {
38-
var test,
38+
function submit( commit, runs, configFile, extra, done ) {
39+
var testName,
3940
testswarm = require( "testswarm" ),
4041
config = grunt.file.readJSON( configFile ).jqueryui,
41-
testBase = config.testUrl + commit + "/tests/unit/",
42-
testUrls = [];
43-
for ( test in tests ) {
44-
testUrls.push( testBase + tests[ test ] );
42+
commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit;
43+
44+
if ( extra ) {
45+
extra = " " + extra;
4546
}
46-
version = version ? ( version + " " ) : "";
47-
testswarm({
47+
48+
for ( testName in runs ) {
49+
runs[ testName ] = config.testUrl + commit + "/tests/unit/" + runs[ testName ];
50+
}
51+
testswarm.createClient({
4852
url: config.swarmUrl,
4953
pollInterval: 10000,
50-
timeout: 1000 * 60 * 45,
51-
done: done
52-
}, {
53-
authUsername: config.authUsername,
54-
authToken: config.authToken,
55-
jobName: 'jQuery UI 1-9 ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
54+
timeout: 1000 * 60 * 45
55+
})
56+
.addReporter( testswarm.reporters.cli )
57+
.auth({
58+
id: config.authUsername,
59+
token: config.authToken
60+
})
61+
.addjob({
62+
name: "jQuery UI 1-9 #<a href='" + commitUrl + "'>" + commit.substr( 0, 10 ) + "</a>" + extra,
63+
runs: runs,
5664
runMax: config.runMax,
57-
"runNames[]": Object.keys(tests),
58-
"runUrls[]": testUrls,
59-
"browserSets[]": ["popular"]
65+
browserSets: config.browserSets
66+
}, function( error, passed ) {
67+
if ( error ) {
68+
grunt.log.error( error );
69+
}
70+
done( passed );
6071
});
6172
}
6273

@@ -76,7 +87,7 @@ grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, mino
7687
allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version;
7788
}
7889
});
79-
submit( commit, allTests, configFile, minor + " core", this.async() );
90+
submit( commit, allTests, configFile, "core " + minor, this.async() );
8091
});
8192

8293
};

0 commit comments

Comments
 (0)