Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 67046 invoked from network); 12 Oct 2009 05:00:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Oct 2009 05:00:23 -0000 Received: (qmail 24684 invoked by uid 500); 12 Oct 2009 05:00:23 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 24599 invoked by uid 500); 12 Oct 2009 05:00:23 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 24590 invoked by uid 99); 12 Oct 2009 05:00:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 05:00:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 05:00:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2456223888DB; Mon, 12 Oct 2009 04:59:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824224 - /couchdb/trunk/share/www/script/couch_test_runner.js Date: Mon, 12 Oct 2009 04:59:59 -0000 To: commits@couchdb.apache.org From: jchris@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091012045959.2456223888DB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jchris Date: Mon Oct 12 04:59:58 2009 New Revision: 824224 URL: http://svn.apache.org/viewvc?rev=824224&view=rev Log: link to submit test failures to a google group Modified: couchdb/trunk/share/www/script/couch_test_runner.js Modified: couchdb/trunk/share/www/script/couch_test_runner.js URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_test_runner.js?rev=824224&r1=824223&r2=824224&view=diff ============================================================================== --- couchdb/trunk/share/www/script/couch_test_runner.js (original) +++ couchdb/trunk/share/www/script/couch_test_runner.js Mon Oct 12 04:59:58 2009 @@ -142,9 +142,63 @@ var text = $(this).text(); totalDuration += parseInt(text.substr(0, text.length - 2), 10); }); - $("#tests tbody.footer td").text(testsRun.length + " of " + tests.length + + $("#tests tbody.footer td").html(""+testsRun.length + " of " + tests.length + " test(s) run, " + testsFailed.length + " failures (" + - totalDuration + " ms)"); + totalDuration + " ms) "); + if (testsFailed.length > 0) { + $("#tests tbody.footer td").append($('Click to Report Test Failures').click(function(e) { + e.preventDefault(); + reportTests(); + })); + } +} + + +function testReport() { + var report = []; + report.push(testPlatform()+"\n"); + $("#tests tbody.content tr").each(function() { + var status = $("td.status", this).text(); + if (status != "not run") { + var dur = $("td.duration", this).text(); + report.push(this.id+"\n "+status+" "+dur); + var details = []; + $("td.details li", this).each(function() { + report.push(" "+$(this).text()); + }); + } + }); + return report.join("\n"); +}; + +function testPlatform() { + var b = $.browser; + var bs = ["mozilla", "msie", "opera", "safari"]; + for (var i=0; i < bs.length; i++) { + if (b[bs[i]]) { + return "Platform: "+ bs[i] + " " + b.version; + } + }; +} + + +function reportTests() { + var summary = $("#tests tbody.footer td span").text(); + var report = testReport(); + var uri = "http://groups.google.com/group/couchdb-test-report/post" + + "?subject=" + escape(summary); + + var d=document; + var f=d.createElement("form"); + // f.style.display='none'; + f.action=uri; + f.method="POST";f.target="_blank"; + var t=d.createElement("textarea"); + t.name="body"; + t.value=report; + f.appendChild(t); + d.body.appendChild(f); + f.submit(); } // Use T to perform a test that returns false on failure and if the test fails, @@ -157,8 +211,9 @@ if ($("td.details ol", currentRow).length == 0) { $("
    ").appendTo($("td.details", currentRow)); } + var message = (arg2 != null ? arg2 : arg1).toString(); $("
  1. Assertion " + (testName ? "'" + testName + "'" : "") + " failed:
  2. ") - .find("code").text((arg2 != null ? arg2 : arg1).toString()).end() + .find("code").text(message).end() .appendTo($("td.details ol", currentRow)); } numFailures += 1