Child pages
  • Sauce OnDemand Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View Sauce OnDemand on the plugin site for more information.

This plugin allows you to integrate Sauce Selenium Testing with Jenkins. Specifically, you can:

  • Automate the setup and tear down of Sauce Connect
  • Integrate the Sauce Labs result videos per test

Configuration

After installing a plugin, specify your Sauce Labs access credentials in the system configuration page as follows:

Once this is set, on each job configuration page, you can tell Jenkins to launch a Sauce Connect instance for the duration of the build. For more details about the concept of SSH tunnel in the context of Sauce Labs, see the documentation.

Embedded Test Reports

You can show an embedded Sauce Labs test report on the test result pages in Jenkins. To enable this, check 'Embed Sauce OnDemand reports' as part of the 'Publish JUnit test result report section'.

In addition, you will need to output the following line to your for each test that is run using Sauce Labs:

SauceOnDemandSessionID=YOUR_SESSION_ID job-name=YOUR_JOB_NAME

where YOUR_SESSION_ID is the SeleniumRC/WebDriver session id and YOUR_JOB_NAME is the name of the test being executed.

Issue Tracking

Please raise any issues you find with the plugin or requests for additional features within the plugin's Jira instance.

Changelog

See https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/CHANGELOG.md

8 Comments

  1. I'm getting the following error after entering my username and api key, and then hitting 'Test Connection'.

    Am using jenkins v1.445 hosted in springsource tc Server v2.6.1, and sauce ondemand plugin v1.7.

    Any idea what the problem is?

    HTTP Status 500 -
    
    type Exception report
    
    message
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception
    
    javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/codehaus/jackson/type/TypeReference
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:605)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)
    	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    	org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    	hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
    	hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    	hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    	hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    root cause
    
    java.lang.NoClassDefFoundError: org/codehaus/jackson/type/TypeReference
    	hudson.plugins.sauce_ondemand.PluginImpl$DescriptorImpl.doValidate(PluginImpl.java:121)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	java.lang.reflect.Method.invoke(Method.java:597)
    	org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
    	org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
    	org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
    	org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
    	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)
    	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    	org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    	hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
    	hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    	hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    	hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    root cause
    
    java.lang.ClassNotFoundException: org.codehaus.jackson.type.TypeReference
    	java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    	java.security.AccessController.doPrivileged(Native Method)
    	java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    	java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    	hudson.plugins.sauce_ondemand.PluginImpl$DescriptorImpl.doValidate(PluginImpl.java:121)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	java.lang.reflect.Method.invoke(Method.java:597)
    	org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
    	org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
    	org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
    	org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
    	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)
    	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
    	org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    	org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    	hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
    	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
    	hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    	hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    	hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
    	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    
  2. Hey Mike, I hope you figured out the Issue by now.  I just ran into the same problem but wanted to post my solution for others (Google didn't seem to have the answer).  I just downloaded the jackson (http://jackson.codehaus.org/) jar (all) from http://wiki.fasterxml.com/JacksonDownload and copied it into plugins/sauce-ondemand/WEB-INF/lib/.  Then just restarted Jenkins and the test button worked.

    1. Hi Doug. Saucelabs have now fixed the problem in the latest v1.8 plugin (http://support.saucelabs.com/entries/20807911) so you can try upgrading to that too.

  3. I just updated my plugin to v1.8 (jenkins v1.448) and all of the sauce-on-demand browser options in the matrix configuration are missing - the checkboxes are there but there are no values. Anyone else experience this? I've reverted back to v1.4 and then tried applying the update to 1.8 again, with no luck.

  4. I'm trying to puppetize the configuration of sauce on demand.  I have the plugin installing.

    My difficulty is in getting the sauce credentials puppetized.  I'm using https://forge.puppetlabs.com/rtyler/jenkins, and it works for the plugin, but seems to only handle user name password credentials, and SSH keys.  

    Does anyone know how the sauce on-demand key can be entered via puppet?  I've tried looking up what type of key it is, and how to feed this into credentials.

    I was looking into method create_or_update_credentials within files/puppet_helper.groovy, and actually called a method to list the credentials... credentials_list_json, within puppet_helper.groovy, and it threw an error when it reached the key...  SauceCredentials

    Unknown macro: {apiKey=<removed actual hashed apiKey>, username='<removed actual username>'}

    , saying it was "unsupported " by puppet_helper.groovy.

    This was on the jenkins where I manually entered the key, to try and see if puppet could read what form it took.  So either SauceCredentials is another form of credential, or I did something wrong trying to obtain details about it.  

    default:
              throw new UnsupportedCredentialsClass("unsupported " + cred)
    Seems like something that would be done on a regular basis, but have spent a day researching, and still not luck.

    Let me know if any more details are needed, and please offer any suggestions for configuring this.

    Thanks.

    1. So what I found out was that the kind was a class.  I build a class of Sauce Credentials type.  I was able to puppetize this by writing a groovy script which adds the credential that I created.

      It runs via localhost/scriptText, which is curled.

      Not sure how many other plugins use custom credential classes, but would need to do something similiar for each.

      Thanks.

  5. Hi, 

    We have sauceconnect already running in different host, where all proxy configuration are already set. Is there a way to let the plugin use the the existing sauce connect. I tried updating the host and url in the advanced option, but the job still try to get binaries and unarchive in the build server.

  6. Please take note that due to issue https://issues.jenkins-ci.org/browse/JENKINS-34358 you have to create a SauceLabs credential before configuring the job. You can then select this credential in the job configuration.

    The Add button creates a UsernamePassword credentials which can't be used by the plugin.