cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsoro...@apache.org
Subject cordova-paramedic git commit: CB-12393 --browserify now affects Sauce runs too
Date Wed, 25 Jan 2017 15:38:29 GMT
Repository: cordova-paramedic
Updated Branches:
  refs/heads/master ce67362e9 -> 872b9d7b3


CB-12393 --browserify now affects Sauce runs too


Project: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/commit/872b9d7b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/tree/872b9d7b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/diff/872b9d7b

Branch: refs/heads/master
Commit: 872b9d7b3c3d56b64bc15c606a2fe42c52b6080f
Parents: ce67362
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Wed Jan 25 18:38:15 2017 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Wed Jan 25 18:38:15 2017 +0300

----------------------------------------------------------------------
 lib/ParamedicConfig.js     | 15 ++++++++++++---
 lib/appium/AppiumRunner.js |  3 ++-
 lib/paramedic.js           |  6 ++++--
 main.js                    |  4 ++++
 4 files changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/872b9d7b/lib/ParamedicConfig.js
----------------------------------------------------------------------
diff --git a/lib/ParamedicConfig.js b/lib/ParamedicConfig.js
index 9a674c1..009068e 100644
--- a/lib/ParamedicConfig.js
+++ b/lib/ParamedicConfig.js
@@ -26,6 +26,7 @@ var DEFAULT_SAUCE_DEVICE_NAME_IOS          = 'iPhone Simulator';
 var DEFAULT_SAUCE_PLATFORM_VERSION_IOS     = '9.3';
 var DEFAULT_SAUCE_APPIUM_VERSION           = '1.5.3';
 var DEFAULT_BUILD_NAME                     = 'Paramedic sauce test';
+var BROWSERIFY_ARG                         = '--browserify ';
 
 var util = require('./utils').utilities;
 
@@ -45,7 +46,7 @@ ParamedicConfig.parseFromArguments = function (argv) {
     return new ParamedicConfig({
         platform:             argv.platform,
         action:               !!(argv.justbuild || argv.justBuild) ? 'build' : 'run',
-        args:                 (!!argv.browserify ? '--browserify ' : ''),
+        args:                 (!!argv.browserify ? BROWSERIFY_ARG : ''),
         plugins:              Array.isArray(argv.plugin) ? argv.plugin : [argv.plugin],
         useTunnel:            !!argv.useTunnel,
         verbose:              !!argv.verbose,
@@ -216,8 +217,16 @@ ParamedicConfig.prototype.setSkipAppiumTests = function (skipAppiumTests)
{
 };
 
 ParamedicConfig.prototype.isBrowserify = function () {
-    return this._config.browserify;
-};
+    return this.args.indexOf(BROWSERIFY_ARG) >= 0;
+}
+
+ParamedicConfig.prototype.setBrowserify = function (browserify) {
+    if (browserify) {
+        this.args += BROWSERIFY_ARG;
+    } else {
+        this.args = this.args.replace(BROWSERIFY_ARG, '');
+    }
+}
 
 ParamedicConfig.prototype.getPorts = function () {
     return {

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/872b9d7b/lib/appium/AppiumRunner.js
----------------------------------------------------------------------
diff --git a/lib/appium/AppiumRunner.js b/lib/appium/AppiumRunner.js
index 3e19059..1415e2f 100644
--- a/lib/appium/AppiumRunner.js
+++ b/lib/appium/AppiumRunner.js
@@ -417,7 +417,8 @@ AppiumRunner.prototype.prepareApp = function () {
     var d = Q.defer();
     var fullAppPath = getFullAppPath(self.options.appPath);
     var deviceString = self.options.device ? ' --device' : '';
-    var buildCommand = 'cordova build ' + self.options.platform + deviceString;
+    var browserifyString = self.options.browserify ? ' --browserify' : '';
+    var buildCommand = 'cordova build ' + self.options.platform + deviceString + browserifyString;
 
     // remove medic.json and (re)build
     shell.rm(path.join(fullAppPath, 'www', 'medic.json'));

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/872b9d7b/lib/paramedic.js
----------------------------------------------------------------------
diff --git a/lib/paramedic.js b/lib/paramedic.js
index 9c377f3..325e083 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -327,7 +327,8 @@ ParamedicRunner.prototype.runAppiumTests = function (useSauce) {
         screenshotPath: path.join(process.cwd(), 'appium_screenshots'),
         output: self.config.getOutputDir(),
         verbose: self.config.isVerbose(),
-        sauce: useSauce
+        sauce: useSauce,
+        browserify: self.config.isBrowserify
     };
     if (useSauce) {
         options.sauceAppPath = 'sauce-storage:' + this.getAppName();
@@ -447,7 +448,8 @@ ParamedicRunner.prototype.getCommandForStartingTests = function () {
 };
 
 ParamedicRunner.prototype.getCommandForBuilding = function () {
-    var cmd = 'cordova build ' + this.config.getPlatformId();
+    var browserifyArg = this.config.isBrowserify() ? ' --browserify' : '';
+    var cmd = 'cordova build ' + this.config.getPlatformId() + browserifyArg;
 
     return cmd;
 };

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/872b9d7b/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 8563acb..172abbe 100755
--- a/main.js
+++ b/main.js
@@ -157,6 +157,10 @@ if (pathToParamedicConfig || // --config
         paramedicConfig.setFileTransferServer(argv.fileTransferServer);
     }
 
+    if (argv.browserify) {
+        paramedicConfig.setBrowserify(true);
+    }
+
     paramedic.run(paramedicConfig)
     .catch(function (error) {
         if (error && error.stack) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message