You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/11/30 12:56:00 UTC

[cordova-paramedic] 02/02: additional comments and logging that explain what the code is doing and why

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-misc
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git

commit 251aa295556b14a51e975c73c5de2aa21df7037b
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Nov 30 12:17:00 2018 +0100

    additional comments and logging that explain what the code is doing and why
---
 lib/PluginsManager.js |  4 +++-
 lib/paramedic.js      | 16 +++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lib/PluginsManager.js b/lib/PluginsManager.js
index 7565a3b..690fc57 100644
--- a/lib/PluginsManager.js
+++ b/lib/PluginsManager.js
@@ -45,6 +45,8 @@ PluginsManager.prototype.installTestsForExistingPlugins = function () {
         // there is test plugin available
         if (fs.existsSync(path.join(plugin.dir, 'tests', 'plugin.xml'))) {
             var additionalArgs = "";
+
+            // special handling for cordova-plugin-file-transfer
             if (plugin.id.indexOf('cordova-plugin-file-transfer') >= 0) {
                 if (me.config.getFileTransferServer()) {
                     // user specified a file transfer server address, so using it
@@ -87,7 +89,7 @@ PluginsManager.prototype.installSinglePlugin = function (plugin) {
 };
 
 PluginsManager.prototype.showPluginsVersions = function () {
-    logger.verbose('cordova-paramedic: versions of installed plugins: ');
+    logger.normal('cordova-paramedic: versions of installed plugins: ');
     exec(this.config.getCli() + ' plugins' + util.PARAMEDIC_COMMON_CLI_ARGS);
 };
 
diff --git a/lib/paramedic.js b/lib/paramedic.js
index a74e142..afaa752 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -324,6 +324,8 @@ ParamedicRunner.prototype.runLocalTests = function () {
         return Q(util.TEST_PASSED);
     }
 
+    logger.info('cordova-paramedic: running tests locally');
+
     return Q().then(function () {
         return self.maybeRunFileTransferServer();
     })
@@ -378,9 +380,14 @@ ParamedicRunner.prototype.runLocalTests = function () {
 ParamedicRunner.prototype.runAppiumTests = function (useSauce) {
     var platform = this.config.getPlatformId();
     var self = this;
+    logger.normal('Start running Appium tests...');
 
-    if (self.config.getAction() === 'build' || !self.config.runAppiumTests()) {
-        logger.normal('Skipping Appium tests...');
+    if (self.config.getAction() === 'build') {
+        logger.normal('Skipping Appium tests: action = build ...');
+        return Q(util.TEST_PASSED);
+    }
+    if (!self.config.runAppiumTests()) {
+        logger.normal('Skipping Appium tests: not configured to run ...');
         return Q(util.TEST_PASSED);
     }
     if (platform !== util.ANDROID && platform !== util.IOS) {
@@ -389,7 +396,7 @@ ParamedicRunner.prototype.runAppiumTests = function (useSauce) {
         return Q(util.TEST_PASSED);
     }
     if (!useSauce && (!self.targetObj || !self.targetObj.target)) {
-        throw new Error('Cannot determine device name for Appium');
+        throw new Error('Cannot determine local device name for Appium');
     }
 
     logger.normal('Running Appium tests ' + (useSauce ? 'on Sauce Labs' : 'locally'));
@@ -440,6 +447,7 @@ ParamedicRunner.prototype.runAppiumTests = function (useSauce) {
 ParamedicRunner.prototype.runTests = function () {
     var isTestPassed = false;
     var self = this;
+    // Sauce Labs
     if (this.config.shouldUseSauce()) {
         return this.runSauceTests()
         .then(function (result) {
@@ -449,6 +457,7 @@ ParamedicRunner.prototype.runTests = function () {
         .then(function (isAppiumTestPassed) {
             return isTestPassed == util.TEST_PASSED && isAppiumTestPassed == util.TEST_PASSED;
         });
+    // Not Sauce Labs
     } else {
         return this.runLocalTests()
         .then(function (result) {
@@ -927,6 +936,7 @@ ParamedicRunner.prototype.runSauceTests = function () {
     logger.info('cordova-paramedic: running tests with sauce');
 
     return Q().then(function () {
+        // Build + "Upload" app
         if (self.config.getPlatformId() === util.BROWSER) {
             // for browser, we need to serve the app for Sauce Connect
             // we do it by just running "cordova run" and ignoring the chrome instance that pops up


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