seriema / angular-apimock

Automatically route your API calls to static JSON files, for hiccup free front–end development.

Home Page:johansson.jp/angular-apimock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SauceLabs failing on PR's

seriema opened this issue · comments

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.

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'

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

  • If the user isn't allowed by Travis to run the SauceLabs test, then skip them without failing the build
  • Otherwise, run the SauceLabs test and fail the build if the task fails

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

Conditional Failure Reference
`[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run saucelabs false`
`[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run saucelabs true`
`[ "${TRAVIS_PULL_REQUEST}" = "true" ] npm run saucelabs`