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 2019/04/23 17:06:34 UTC
[cordova-paramedic] branch master updated: Improve Local Testing
(#130)
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git
The following commit(s) were added to refs/heads/master by this push:
new 344438b Improve Local Testing (#130)
344438b is described below
commit 344438b3fce6d4c57bdc1dc0e68c56dab772ce5d
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Wed Apr 24 02:06:30 2019 +0900
Improve Local Testing (#130)
* clean up package.json
* clean up error output (unrelated to PR)
* test ALL the Xcode versions
* remove too old xcode verions
* quote target
* complete emulator string as target instead of just device
* Update ParamedicTargetChooser.js
* Refactor for Local Testing
* Add back ios-12.2
* Revert chooseTargetForIOS change
* Only test Xcode 10.2 local
---
.travis.yml | 5 +----
lib/ParamedicLogCollector.js | 2 +-
lib/paramedic.js | 2 +-
lib/utils/utilities.js | 19 +++++++++----------
package.json | 6 +++---
5 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 5c779d7..78ce0dc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,11 +39,9 @@ matrix:
include:
# one local test, without saucelabs
- env: PLATFORM=local
- os: osx
- osx_image: xcode9
+ <<: *_ios
# many tests with saucelabs
-
- env: PLATFORM=browser-chrome
- env: PLATFORM=browser-firefox
- env: PLATFORM=browser-safari
@@ -89,4 +87,3 @@ script:
- if [[ "$PLATFORM" =~ local ]]; then npm run test-ios; fi
- if [[ "$PLATFORM" =~ TODO ]]; then npm run test-android; fi
- if [[ "$PLATFORM" != local ]]; then node main.js --config ./pr/$PLATFORM --plugin ./spec/testable-plugin/ --shouldUseSauce --buildName travis-paramedic-$TRAVIS_JOB_NUMBER; fi
-
diff --git a/lib/ParamedicLogCollector.js b/lib/ParamedicLogCollector.js
index 00b90cd..65f1c43 100644
--- a/lib/ParamedicLogCollector.js
+++ b/lib/ParamedicLogCollector.js
@@ -91,7 +91,7 @@ class ParamedicLogCollector {
if (result.code > 0) {
logger.error('Failed to run command: ' + logCommand);
- logger.error('Code Failure: ' + result.code);
+ logger.error('Failure code: ' + result.code);
return;
}
diff --git a/lib/paramedic.js b/lib/paramedic.js
index b401b71..1afa0d1 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -393,7 +393,7 @@ class ParamedicRunner {
return Q().then(() => paramedicTargetChooser.chooseTarget(/* useEmulator= */true, /* preferredTarget= */this.config.getTarget()))
.then((targetObj) => {
this.targetObj = targetObj;
- cmd += ' --target ' + this.targetObj.target;
+ cmd += ` --target "${this.targetObj.target}"`;
// CB-11472 In case of iOS provide additional '--emulator' flag, otherwise
// 'cordova run ios --target' would hang waiting for device with name
diff --git a/lib/utils/utilities.js b/lib/utils/utilities.js
index 23c02c3..78e1d45 100644
--- a/lib/utils/utilities.js
+++ b/lib/utils/utilities.js
@@ -61,24 +61,23 @@ function getSimulatorsFolder () {
}
function getSimulatorModelId (cli, target) {
- let findSimCommand;
- if (target) {
- findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep ' + target + ' | tail -n1';
- } else {
- findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep ^iPhone | tail -n1';
- }
+ target = target || '^iPhone';
+
+ // Command to fetch for a list of simulators by target. defaults to (^iPhone)
+ const cmd = `${cli} run --list --emulator${module.exports.PARAMEDIC_COMMON_CLI_ARGS} | grep "${target}" | tail -n1`;
logger.info('running:');
- logger.info(' ' + findSimCommand);
+ logger.info(' ' + cmd);
- const findSimResult = exec(findSimCommand);
+ // Results of the fetching command.
+ const results = exec(cmd);
- if (findSimResult.code > 0) {
+ if (results.code > 0) {
logger.error('Failed to find simulator we deployed to');
return;
}
- return findSimResult.stdout;
+ return results.stdout;
}
function getSimulatorId (findSimResult) {
diff --git a/package.json b/package.json
index 9572ef3..ddcb279 100644
--- a/package.json
+++ b/package.json
@@ -23,14 +23,14 @@
"test-local": "npm run test-browser && npm run test-android && npm run test-ios",
"test-local-on-windows": "npm run test-browser && npm run test-android",
"test-android": "node main.js --platform android --plugin ./spec/testable-plugin/",
- "test-ios": "node main.js --platform ios --plugin ./spec/testable-plugin/ --args=--buildFlag='-UseModernBuildSystem=0' --verbose",
+ "test-ios": "node main.js --platform ios --plugin ./spec/testable-plugin/ --verbose",
"test-windows": "node main.js --platform windows --plugin ./spec/testable-plugin/",
"test-browser": "node main.js --platform browser --plugin ./spec/testable-plugin/",
"test-saucelabs": "npm run test-saucelabs-browser && npm run test-saucelabs-ios && npm run test-saucelabs-android",
"test-saucelabs-on-windows": "npm run test-saucelabs-browser && npm run test-saucelabs-android",
"test-saucelabs-browser": "node main.js --config ./pr/browser-chrome --plugin ./spec/testable-plugin/ --shouldUseSauce",
- "test-saucelabs-ios": "cordova-paramedic: installing node main.js --config ./pr/ios-10.0 --plugin ./spec/testable-plugin/ --shouldUseSauce",
- "test-saucelabs-android": "cordova-paramedic: installing node main.js --config ./pr/android-7.0 --plugin ./spec/testable-plugin/ --shouldUseSauce"
+ "test-saucelabs-ios": "node main.js --config ./pr/ios-10.0 --plugin ./spec/testable-plugin/ --shouldUseSauce",
+ "test-saucelabs-android": "node main.js --config ./pr/android-7.0 --plugin ./spec/testable-plugin/ --shouldUseSauce"
},
"keywords": [
"cordova",
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org