apache / cordova-paramedic

Apache Cordova - Paramedic
https://cordova.apache.org/
Apache License 2.0
36 stars 53 forks source link

CI: Broken for TEST_DIR tests #141

Closed janpio closed 5 years ago

janpio commented 5 years ago

TEST_DIR:

0.99s$ $PARAMEDIC_COMMAND --config ./pr/$PLATFORM --plugin $PARAMEDIC_PLUGIN_TO_TEST --buildName $PARAMEDIC_BUILDNAME
cordova-paramedic: looking for a config here: /Users/travis/build/apache/cordova-plugin-camera/pr
cordova-paramedic: looking for a config here: /Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/cordova-paramedic/conf/pr/.config.json
/Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/cordova-paramedic/lib/utils/utilities.js:184
    throw new Error('Can\'t find the specified config.');
    ^
Error: Can't find the specified config.
    at Object.getConfigPath (/Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/cordova-paramedic/lib/utils/utilities.js:184:11)
    at Object.<anonymous> (/Users/travis/.nvm/versions/node/v6.14.3/lib/node_modules/cordova-paramedic/main.js:74:34)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
The command "$PARAMEDIC_COMMAND --config ./pr/$PLATFORM --plugin $PARAMEDIC_PLUGIN_TO_TEST --buildName $PARAMEDIC_BUILDNAME" exited with 1.

Examples: https://travis-ci.org/apache/cordova-plugin-camera/jobs/530514187 https://travis-ci.org/apache/cordova-plugin-camera/jobs/530514188


Problem is that Paramedic itself doesn't have any tests of this kind, so it is difficult to test here in this repo first :/

janpio commented 5 years ago

This only seems to apple to cordova-plugin-camera and cordova-plugin-splashscreen.

The previous travis.yml had this:

  - if [[ "$TEST_DIR" != "" ]]; then
      cd $TEST_DIR;
      npm install;
      npm test;
    else
      cordova-paramedic --config pr/$PLATFORM --plugin . --shouldUseSauce --buildName travis-plugin-camera-$TRAVIS_JOB_NUMBER;
fi

It is used via TEST_DIR=. or TEST_DIR=./tests/ios.

The first one is obsolete, as the tests now always run npm test before doing the paramedic stuff.

The second one runs native tests via xcodebuild like https://github.com/apache/cordova-plugin-camera/tree/master/tests/ios or https://github.com/apache/cordova-plugin-splashscreen/tree/master/tests/ios.

janpio commented 5 years ago

I think we should rename this to ADDITIONAL_TESTS and recreate the if/else with the paramedic call.