[JIRA] [sauce-ondemand-plugin] (JENKINS-30778) Sauce Labs Test Publisher Configuration

3 views
Skip to first unread message

grulex@gmail.com (JIRA)

unread,
Oct 3, 2015, 12:01:03 PM10/3/15
to jenkinsc...@googlegroups.com
Alex G. created an issue
 
Jenkins / Bug JENKINS-30778
Sauce Labs Test Publisher Configuration
Issue Type: Bug Bug
Assignee: Kohsuke Kawaguchi
Components: sauce-ondemand-plugin
Created: 03/Oct/15 4:00 PM
Labels: plugin configuration
Priority: Major Major
Reporter: Alex G.

I'm using TestNG (also tried JUnit) to run tests in Sauce Labs cloud. In order to update the pass/fail status of those tests in Sauce Labs once they done, I added the "Run Sauce Labs Test Publisher" post-build action to my Jenkins build.

First of all, the documentation isn't even clear about how this integration must be configured. This is what it says: "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." What does that mean? To your what?

Based on source code, I figured there has to be <system-out> tag in the Surefire XML Report, the content of which must be that line. But that doesn't make much sense, because those tags are only generated when an error happens. Also no matter what I've tried, I just could make Surefire/TestNG output that tag into the report at all. Not even when test failed.

I'm either not understanding something (probably) or this way of configuring things is messed up.

Last few lines of my log:
Starting post-build for Sauce Labs plugin
Finished post-build for Sauce Labs plugin
Recording test results
Starting Sauce Labs test publisher
Finished Sauce Labs test publisher
Starting Sauce Labs test publisher
Finished Sauce Labs test publisher

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

grulex@gmail.com (JIRA)

unread,
Oct 3, 2015, 12:03:01 PM10/3/15
to jenkinsc...@googlegroups.com
Alex G. updated an issue
Change By: Alex G.
I'm using TestNG (also tried JUnit) to run tests in Sauce Labs cloud. In order to update the pass/fail status of those tests in Sauce Labs once they done, I added the "Run Sauce Labs Test Publisher" post-build action to my Jenkins build.

First of all, the documentation isn't even clear about how this integration must be configured. This is what it says: "In addition, you will need to output the following line *{color:red}to your {color}* for each test that is run using Sauce Labs: SauceOnDemandSessionID=YOUR_SESSION_ID job-name=YOUR_JOB_NAME." What does that mean? *To your what?*

Based on source code, I figured there has to be <system-out> tag in the Surefire XML Report, the content of which must be that line. But that doesn't make much sense, because those tags are only generated when an error happens. Also no matter what I've tried, I just
 could  couldn't  make Surefire/TestNG output that tag into the report at all. Not even when test failed.


I'm either not understanding something (probably) or this way of configuring things is messed up.

Last few lines of my log:
Starting post-build for Sauce Labs plugin
Finished post-build for Sauce Labs plugin
Recording test results
Starting Sauce Labs test publisher
Finished Sauce Labs test publisher
Starting Sauce Labs test publisher
Finished Sauce Labs test publisher

sven@styla.com (JIRA)

unread,
Oct 21, 2015, 11:52:01 AM10/21/15
to jenkinsc...@googlegroups.com
Sven Ehlert commented on Bug JENKINS-30778
 
Re: Sauce Labs Test Publisher Configuration

I have the exact same problem. Tests results are not shown on Jenkins. I get the same output on the log as the original reporter

sven@styla.com (JIRA)

unread,
Oct 21, 2015, 11:59:01 AM10/21/15
to jenkinsc...@googlegroups.com

No report printed, but with different testing framworks

acampbell@saucelabs.com (JIRA)

unread,
Oct 22, 2015, 7:10:04 PM10/22/15
to jenkinsc...@googlegroups.com
Andrew Campbell assigned an issue to Andrew Campbell
 
Change By: Andrew Campbell
Assignee: Kohsuke Kawaguchi Andrew Campbell

acampbell@saucelabs.com (JIRA)

unread,
Oct 26, 2015, 1:54:02 PM10/26/15
to jenkinsc...@googlegroups.com
Andrew Campbell commented on Bug JENKINS-30778
 
Re: Sauce Labs Test Publisher Configuration

Hi Sven Ehlert y Alex G., regarding this line from the documentation....

First of all, the documentation isn't even clear about how this integration must be configured. This is what it says: "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." What does that mean? To your what?

It is confusing and we will work to alter the docs to be more clear in the future. In the meantime I can clarify. In this case, intended destination of the session ID text is the standard output console or Jenkins.

However, there could be an easier way to accomplish what you are looking for and a code example can be found here. The SauceOnDemandTestWatcher class should listen for test completion and output the results to console for you. I would advise having a look as I think it could be helpful for both of you.

I hope this helps and please do let me know if there are any questions.

mark.han@willowtreeapps.com (JIRA)

unread,
Nov 8, 2019, 2:19:03 PM11/8/19
to jenkinsc...@googlegroups.com
Mark Han commented on Bug JENKINS-30778

2019 and the same documentation still exists :\ the SauceOnDemandTestWatcher.java class helped.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

danzh@hotmail.com (JIRA)

unread,
Nov 13, 2019, 4:21:04 PM11/13/19
to jenkinsc...@googlegroups.com

based on the online doc, you also need this:

capabilities.setCapability("build", System.getenv("JOB_NAME")  "__"  System.getenv("BUILD_NUMBER"));

{{}}

{{}}In my jenkins environment: "BUILD_TAG" is correct.

 

 

Reply all
Reply to author
Forward
0 new messages