Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Extract Sauce authentication ENV vars from Jenkins Plugin #314

Open
bootstraponline opened this issue May 5, 2015 · 4 comments
Open

Extract Sauce authentication ENV vars from Jenkins Plugin #314

bootstraponline opened this issue May 5, 2015 · 4 comments

Comments

@bootstraponline
Copy link
Contributor

The Sauce on demand plugin looks for SAUCE_API_KEY and the sauce_ruby gem supports only SAUCE_ACCESS_KEY. The ENV situation with sauce is a nightmare. I'd expect the gem to support all 4 variations and work out of the box with the Jenkins plugin.

-----------------------------------------------------------------------
    Your Sauce username and/or access key are unavailable. Please:
    1.  Set the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables. 
@bootstraponline bootstraponline changed the title Interopreate with Jenkins Plugin Interoperate with Jenkins Plugin May 5, 2015
@bootstraponline
Copy link
Contributor Author

username = hash.delete("SAUCE_USERNAME") || hash.delete("SAUCE_USER_NAME")
access_key = hash.delete("SAUCE_ACCESS_KEY") || hash.delete("SAUCE_API_KEY")

I see at least one place in the Ruby code that checks all four so it's not clear why the ENVs being set by the Java plugin aren't being detected.

@bootstraponline bootstraponline changed the title Interoperate with Jenkins Plugin Extract Sauce authentication ENV vars from Jenkins Plugin May 6, 2015
@DylanLacey
Copy link
Contributor

Hmm, I'll investigate when I get a chance. I agree the gem should be overly permissive about what you call your vars.

@bootstraponline
Copy link
Contributor Author

I think this is it since I'm running the tests via Rake.

def run_parallel_tests(t, args, command)
  if ParallelTests.number_of_running_processes == 0
    username    = ENV["SAUCE_USERNAME"].to_s
    access_key  = ENV["SAUCE_ACCESS_KEY"].to_s

It's only checking those exact env vars.

@bootstraponline
Copy link
Contributor Author

There are multiple places where only one ENV variable is checked so they'd all have to be fixed (ideally using a helper method).

 SAUCE_USERNAME = ENV["SAUCE_USERNAME"]
 SAUCE_ACCESS_KEY = ENV["SAUCE_ACCESS_KEY"]
 AUTH_DETAILS = "#{SAUCE_USERNAME}:#{SAUCE_ACCESS_KEY}"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants