Jenkins Allure does not generate valid links based on #issue - jenkins

I have my .featue file which contains at the beginning the annotation #issue=JIRA-123. Afer I run the cucumber Selenium script I get my json outputs. These output contains the following part: "links":[{"name":"JIRA-123","type":"issue"}],
Allure does create a valid report with the issue, but the link does not work correctly.
The following properties had been set in my jenkins. I guess they are correct.
Allure generates the following report and sets the given link for the issue.
The link points directly to the dashboard of the test. What must I change in order to get a valid link in the issue section of the report?

Related

How to write out a line to the default HTML reporter in Playwright?

I am using the default HTML reporter in Playwright. I would like to write out some custom text to the default reporter in the Test Steps Section. What is the command to do this? I am not seeing it off the page object.
Currently this line does not appear in the Test Steps section but instead appears in the Attachments.stdout
console.log("Begin Order Workflow")
You might find something of use here.
https://playwright.dev/docs/api/class-reporter
Annotations are key/value pairs accessible via test.info().annotations.
The HTML reporter will show Annotations that are added to tests. So in a test you could add this line:
test.info().annotations.push({ type: 'issue', description: 'descriptive text' });

How to get RobotFramework post test results with latest timestamp in Jenkins

I am executing robot test results using timestampoutput command to store results , whenever i execute this it will create me a log & report results ending with timestamp . But my problem is how to get the test report/log in jenkins post results which are generated in that timestamp.Please let me know if this is the right approach or any alternate solution is there. Any guidance is appreciated. Thanks
pybot --outputdir var/test-results/%date:~-4,4%%date:~-10,2%%date:~-7,2% --timestampoutputs
Output: var\test-results\20170601\output-20170601-155017.xml
Log: var\test-results\20170601\log-20170601-155017.html
Report: var\test-results\20170601\report-20170601-155017.html
The date formatting and Jenkins Robot Framework Publish results plugin are two approaches that conflict each other. The publish result plugin copies the contents of the output folder to a new folder that is in line with the build number. This ensures uniqueness and using the Jenkins UI all the information about when a build was initiated is found, it should not need a folder name based on a date.

app real path issue in spock integration test case

I am working on integration test case of an action which generate pdf using jasper. That jasper have a sub-report. To get the path of the sub-report (abc.jasper in web-app/reports/) I am first fetching real path using
request.getSession().getServletContext().getRealPath("")
which gives /home/mkb/workspace/my-project/web-app and then concatenating /reports/abc.jasper to get the sub-report in parent jasper report. This is working fine when running the application (run-app).
But while testing (test-app) above code giving /home/mkb/workspace/my-project/target/work/scriptCache and hence I am getting
net.sf.jasperreports.engine.JRException: Resource not found at :
/home/mkb/workspace/my-project/target/work/scriptCache/reports/abc.jasper
How can I set or fix this path issue in test cases? (Grails 2.3.9)
Please use ServletContextHolder class static method getRealPath() to get the real path.e.g :-
ServletContextHolder.servletContext.getRealPath('/')
This code will give the path of web-app folder of your application.

Fail Jenkins Build based on build output and email failed log sections

I want to make the build fail by analyzing the results of the console log, for a mac project I am building. It builds each module and gives the results like this:
###################################
XX XXX XXX
##########################
It then returns BUILD FAILED
I want to show that the build failed at the end of the console output, and at the same time I want to know which module failed. It should be sent by email since I am already using the email-ext plugin.
I am unsure of what needs to be done; I am aware of text-finder, log parser and setting the run condition - but do not know what steps to follow.
You will need to use the text-finder plugin and the email-ext plugin together in order to accomplish both your objectives.
First set up the text-finder plugin and provide an appropriate regex. Something like: .*(?i)failed.*|.*(?i)error.* would find the words "failed" or "error" in a case insensitive manner. You will need to specify a path to your log files and probably want to check the "Also search console output" check box.
This will cause any build which outputs "failed" or "error" to fail in Jenkins.
Your requirement to email the module which failed is a little more complex, but possible with the email-ext plugin. This plugin allows you to specify a regex which is used to gather email content using a special token which accepts arguments. The full argument list and token name is: ${BUILD_LOG_REGEX, regex, linesBefore, linesAfter, maxMatches, showTruncatedLines, substText, escapeHtml, matchedLineHtmlStyle}
Most of these arguments are optional, something like this should do the trick for you: ${BUILD_LOG_REGEX, regex=".*(?i)failed.*|.*(?i)error.*", linesBefore=10, linesAfter=10}. Put this in the "Default Content" section of the email-ext configuration. You can specify multiple tokens as well, see this answer for instructions to get the full list: Jenkins Email-ext plugin - tokens
You can of course edit the LinesBefore and LinesAfter parameters to suit your needs.

Passing URL parameters to a TFS Report (2010)

I have a very simple report constructed using Report Builder 2.0 talking to analysis services for TFS 2010. The report shows the number of active bugs logged against a particular Team Project, sorted by priority.
I have several team projects, and I don't want to duplicate the same report for each one. Instead, I would like to pass in the team project as a parameter in the URL. A search of the web shows good guidance from John Socha-Leialoha on how to do this (finding the MDX parameter and constructing the query).
I have set a default on the report to point to a particular team project and the report presents the expected information, when I add a parameter to the URL the report fails to run, and displays the following message: 'Value cannot be null. Parameter name: main'
The following URL displays the report correctly with the default team project:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart
I've also tried appending the parameter, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&tf:Parameters=TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
This, also, generates the message: 'Value cannot be null. Parameter name: main'
This led me to the realization that I needed to escape the & symbol, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&tf:Parameters=TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&26[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
However, the report still fails to run, and displays the same error message.
Since it is not referenced in Socha's example, I have also tried running the report while omitting the &tf: parameters tag, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&26[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
This doesn't seem to work either. At this point, I'm happy for any advice/guidance I can get.
Maybe this blog post helps you: http://ewaldhofman.nl/post/2009/06/02/Add-SSRS-report-as-dashboard-to-sharepoint.aspx

Resources