Build Failure while integrating Jenkins with HP ALM - jenkins

Created a Build for running Selenium Maven Scripts through jenkins and publish Results in HP ALM.
Steps I follow:-
1.Add ALM ServerName and ALM URL under Configure System>> Manage Jenkins
2.Add Build Step>> Execute HP Functional Tests from HPALM
Added the test Set Value as Root\TestSet\TestSetFolder
3.Add Post Build Action>>Publish HP Tests Result>> Reports archive Mode
4.Add>>Upload Test Result to ALM
Testing Frameowrk = Junit, Test Folder = "TestSet\TestSetFolder\TestCaseName ,Test Set Folder = "TestSet\TestSetFolder, Testing result file ="**/junitResult.xml
5. Run the Build and getting the Failure whereas my particular selenium scripts get passed. Below is the Error for Console Output.

I had the same problem, that was because of "\" which were escaped by Jenkins. I don't why. If you remove them and always have a bad path you should have a trace like that :
Run mode is set to: RUN_PLANNED_HOST
Could not find TestSet Subject/Scenario/BAD_PATH/TEST_SET
================================================
Run status: Job failed, total tests: 0, succeeded: 0, failures: 0, errors: 0
================================================
Build step 'Execute HPE functional tests from HPE ALM' changed build result to FAILURE
Finished: FAILURE
Personnaly I solved the problem replacing "\" by "\\".

Related

Generate JUnit / TestNg like reports manually in Jenkins

I have test cases as executables ( windows exe ) and I am running all the test cases (exe) in Jenkins. Each test case produce output text file and at the end of the testcase, there is a formatted string like "TestCaseName PASSED/FAILED".
I can see from the build status if all the test cases were successful or not but if any of them fails, the build also says it fails. I want to use Jenkins Test Results Analyser or any other plugin to show as a table to see in which build which test case failed. The Jenkins Test Results Analyser works fine with jUnit or TestNg test reports. I was to thinking to generate manually such reports as post build step or if there is any other tool available?

Build step 'Publish Performance test result report' changed build result to FAILURE Finished: FAILURE

Cannot detect file type because of error, and : Failed to copy Build step 'Publish Performance test result report' changed build result to FAILURE Finished: FAILURE. whenever i run the script always i face this..
Take a look into Jenkins Console Output - it should give you the reason for the failure.
Most probably the Performance Plugin fails to find JMeter's .jtl results file in Jenkins Workspace, either the .jtl results file is missing or you're pointing the Performance Plugin to the incorrect location.
If you have a Script step to run a JMeter test like:
jmeter -n -t test.jmx -l result.jtl
You should be able to use simply result.jtl in the Performance Plugin.
Check out:
Performance Trend Reporting
How to Use the Jenkins Performance Plugin
and Running Performance Tests articles for more details on various aspects of Jenkins Performance Plugin use cases.

Fail Jenkins build when xUnit tests do not pass

I have Jenkins building my C# .NET Core api project. I added some xUnit tests and included a powershell script inside of my Jenkins build with the "dotnet test" command to execute the tests.
That all works well and the tests are run and i can see the output in the Jenkins console.
The problem is that if i have failing tests nothing happens - jenkins goes merrily along and finished up the build process and reports it as a success.
How can i get it to fail the build?
Is there a response from the 'dotnet test' command?
I know there are xUnit Jenkins plugins but they all seem to revolve around "display the results of xUnit tests". Which is not really what i am after. I want to ACT on the results of the tests, not just see them in fancy html.
You should check for the return code from dotnet test command. It returns 0 if all tests were successful and 1 if any of the tests failed. Unfortunately it's not documented but was confirmed in this issue

Jenkins fails Jest tests that otherwise works (corporate proxy)

I am sitting behind corporate proxy.
So basically test is just page.goto("https://") I created Freestyle project and made it execute code in command line:
cd C:/Testing
npm test -- Jenkins
If I run these commands on machine where Jenkins is running, everything works and test passes. However, if I run it using Jenkins, this error appears:
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Main Project
[Main Project] $ cmd /c call C:\Windows\TEMP\jenkins7770552654778169643.bat
C:\Program Files (x86)\Jenkins\workspace\Main Project>cd C:/Testing
C:\Testing>npm test -- Jenkins
> testing#1.0.0 test C:\Testing
> jest "Jenkins"
FAIL .\Jenkins.test.js (5.023s)
Describe
× Test (513ms)
� Describe › Test
net::ERR_TUNNEL_CONNECTION_FAILED at https://google.com/
at navigate (node_modules/puppeteer/lib/Page.js:539:37)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 6.587s
Ran all test suites matching /Jenkins/i.
npm ERR! Test failed. See above for more details.
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
I checked Jenkins HTTP Proxy Configuration and it was set up correctly (host, port and credentials are all correct), but if I enter https://google.com/ in Test URL and press "Validate Proxy", this error appears:
Failed to connect to https://google.com/ (code 407).
Is there something that can refuse Jenkins requests to websites? Windows Defender firewall is disabled.

Jenkins - Build Status

I've created one Jenkins job to execution 5 test cases and it works, but not in terms of build creation.
Build status is coming as SUCCESS even if there is any failure test
cases during execution.
For instance, 2 test cases out of 5 got failed during my recent run, but the build status has become SUCCESS!!!
Please help me in correcting this.....
Note: I'm using Jenkins 1.617 & ANT 1.9.4 for the integration.
If you are executing junits in jenkins, default status is unstable for jenkins job and success for maven/ant build.
If you are using an ant build add the below property to junit task to make the build failed failureproperty="test.failed". If you want to fail the build even if one junit fails, add property haltonfailure="yes"
If you are using maven add the argument -Dmaven.test.failure.ignore=false

Resources