seriema / angular-apimock

Automatically route your API calls to static JSON files, for hiccup free front–end development.
johansson.jp/angular-apimock
MIT License
65 stars 8 forks source link

SauceLabs failing on PR's #31

Closed seriema closed 9 years ago

seriema commented 9 years ago

This happened when PR #29 triggered a build that failed. Seems to be user account related:

L838: You used username 'None' and access key 'None' to authenticate, which are not valid Sauce Labs credentials.

The subsequent build by me worked, so I guess it's on PR's from other users accounts. Even though it's triggered by Travis which has credentials.

seriema commented 9 years ago

Seems like it's a Travis security feature:

Note that due to security restrictions, the Sauce Labs addon is not available on pull request builds.

They suggest a workaround:

To work around this, you could restrict these tests only to situations where the environment variables are available, or disable them for pull requests entirely. Here’s an example of how to structure a build command for this purpose:

script:
  - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && bundle exec rake tests:integration || false'
seriema commented 9 years ago

Doh! Now failing SauceLabs tests still pass the build. The goal is:

seriema commented 9 years ago

It's running SauceLabs on PR's when it shouldn't...

Conditional Failure Reference
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run saucelabs || false Fails PR regardless Build
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run saucelabs || true Ignores failed SL result Build
[ "${TRAVIS_PULL_REQUEST}" = "true" ] || npm run saucelabs Runs SL on PR Build