couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject fauxton commit: updated refs/heads/master to 0e34b78
Date Tue, 26 May 2015 18:15:21 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master ea85d2b76 -> 0e34b78c4


Prevent duplicate mocha tests running

When running mocha for environments where Fauxton has been
extended, e.g. the Cloudant dashboard, tests unique to that other
environment get run twice because the original tests are included
once from the original folder and once from where they've been
copied - in the Fauxton /app folder. Since we know that the files
would need to be copied over to the /app folder for inclusion
in Fauxton, this PR removes the extra tests from the original
source.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/0e34b78c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/0e34b78c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/0e34b78c

Branch: refs/heads/master
Commit: 0e34b78c4b2de756d3dd60d3a135024039fe622a
Parents: ea85d2b
Author: Ben Keen <ben.keen@gmail.com>
Authored: Tue May 26 10:50:31 2015 -0700
Committer: Ben Keen <ben.keen@gmail.com>
Committed: Tue May 26 10:50:31 2015 -0700

----------------------------------------------------------------------
 app/load_addons.js.underscore | 2 +-
 tasks/fauxton.js              | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0e34b78c/app/load_addons.js.underscore
----------------------------------------------------------------------
diff --git a/app/load_addons.js.underscore b/app/load_addons.js.underscore
index e6a49f7..eb408c4 100644
--- a/app/load_addons.js.underscore
+++ b/app/load_addons.js.underscore
@@ -16,7 +16,7 @@
  * THIS IS A GENERATED FILE. DO NOT EDIT.
  */
 define([
-  <%= '"' + deps.join('","') + '"' %>
+  <%= '"' + deps.join('",\n"') + '"' %>
 ],
 function () {
   var LoadAddons = {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0e34b78c/tasks/fauxton.js
----------------------------------------------------------------------
diff --git a/tasks/fauxton.js b/tasks/fauxton.js
index 257d8fb..ed5c021 100644
--- a/tasks/fauxton.js
+++ b/tasks/fauxton.js
@@ -116,6 +116,12 @@ module.exports = function (grunt) {
     var fileSrc = grunt.option('file') || data.files.src;
     var testFiles =  grunt.file.expand(fileSrc);
 
+    // filter out any tests that aren't found in the /app/ folder. For scripts that are extending
Fauxton, we still
+    // know that all addons will have been copied into /app. This prevent tests being ran
twice
+    testFiles = _.filter(testFiles, function (filePath) {
+      return /\/app\//.test(filePath);
+    });
+
     var configTemplate = _.template(grunt.file.read(configTemplateSrc));
     // a bit of a nasty hack to read our current config.js and get the info so we can change
it
     // for our testing setup


Mime
View raw message