Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Adding job name for pull request jobs coming from mergeatron
authorCorey Frang <gnarf@gnarf.net>
Sat, 24 Nov 2012 23:59:56 +0000 (17:59 -0600)
committerCorey Frang <gnarf@gnarf.net>
Sun, 25 Nov 2012 00:00:14 +0000 (18:00 -0600)
grunt.js

index 64cce4a..87d9333 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -126,11 +126,21 @@ module.exports = function( grunt ) {
        grunt.loadNpmTasks( "grunt-update-submodules" );
 
        grunt.registerTask( "testswarm", function( commit, configFile ) {
-               var testswarm = require( "testswarm" ),
+               var jobName,
+                       testswarm = require( "testswarm" ),
                        testUrls = [],
+                       pull = /PR-(\d+)/.exec( commit ),
                        config = grunt.file.readJSON( configFile ).jquery,
                        tests = "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue serialize support traversing Sizzle".split(" ");
 
+               if ( pull ) {
+                       jobName = "jQuery Pull Request <a href='https://github.com/jquery/jquery/pull/" +
+                               pull[ 2 ] + "'>#" + pull[ 2 ] + "</a>";
+               } else {
+                       jobName = "jQuery commit #<a href='https://github.com/jquery/jquery/commit/" +
+                               commit + "'>" + commit.substr( 0, 10 ) + "</a>";
+               }
+
                tests.forEach(function( test ) {
                        testUrls.push( config.testUrl + commit + "/test/index.html?module=" + test );
                });
@@ -143,7 +153,7 @@ module.exports = function( grunt ) {
                }, {
                        authUsername: config.authUsername,
                        authToken: config.authToken,
-                       jobName: "jQuery commit #<a href='https://github.com/jquery/jquery/commit/" + commit + "'>" + commit.substr( 0, 10 ) + "</a>",
+                       jobName: jobName,
                        runMax: config.runMax,
                        "runNames[]": tests,
                        "runUrls[]": testUrls,

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf