Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SauceLabs failing on PR's #31

Closed
seriema opened this issue Sep 13, 2015 · 3 comments
Closed

SauceLabs failing on PR's #31

seriema opened this issue Sep 13, 2015 · 3 comments
Assignees
Labels

Comments

@seriema
Copy link
Owner

seriema commented Sep 13, 2015

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 seriema added the bug label Sep 13, 2015
@seriema seriema self-assigned this Sep 13, 2015
@seriema
Copy link
Owner Author

seriema commented Sep 13, 2015

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'

MartinSandstrom added a commit to MartinSandstrom/angular-apimock that referenced this issue Sep 13, 2015
MartinSandstrom added a commit to MartinSandstrom/angular-apimock that referenced this issue Sep 13, 2015
@seriema
Copy link
Owner Author

seriema commented Sep 13, 2015

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

@seriema seriema reopened this Sep 13, 2015
@seriema
Copy link
Owner Author

seriema commented Sep 13, 2015

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`

@seriema seriema reopened this Sep 13, 2015
seriema added a commit that referenced this issue Sep 13, 2015
Testing CI stuff is hard… ;) Doing this as my own PR now so I can amend
commits until it works as expected.

I should’ve read the docs better: “The environment variable
${TRAVIS_PULL_REQUEST} is set to "false" when the build is for a normal
branch commit. When the build is for a pull request, it will contain
the pull request’s number.”

Resources:
http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when
-testing-Pull-Requests

Fixes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant