Jenkins Error: [ANALYSIS-COLLECTOR] Skipping publisher since build result is FAILURE - jenkins

Maven project in Jenkins results in FAILURE even though I am not publishing any pmd, checkstyle results. All of them are "not checked" in job configuration.
Compilation is actually success, but because of this error I am unable to trigger following job.
Error is:
[ANALYSIS-COLLECTOR] Skipping publisher since build result is FAILURE
Finished: FAILURE

Related

Xray for JIRA Jenkins Plugin, TestNG XML Results Import task failure

this is my 1st question, any help will be greatly appreciated.
I need to import test results from Jenkins to Xray.
To do so I:
set up Xray for JIRA Jenkins Plugin;
configured Xray Server/DC integration with Jenkins;
tested connection and it's successful;
went to my Jenkins project configuration and set up post-build Action 'Xray:Result Import Task';
under parameters of 'Xray:Result Import Task' I was trying to specify Execution Report File (file path with file name).
AND here is my question: what exact input is supposed to be here?
I tried URL to my test execution issue already created in Xray, testng.xml. myTestExecution.xml file - nope. Doesn't work. I'm missing smthng here((
Can't get what is meant by:
file path with file name.
My Results Import task fails with error below.
Starting XRAY: Results Import Task...
##########################################################
#### Xray is importing the execution results ####
##########################################################
0 files found. Please make sure the path provided is valid and is not a directory
ERROR: Build step failed with exception
com.xpandit.plugins.xrayjenkins.exceptions.XrayJenkinsGenericException: 0 files found. Please make sure the path provided is valid and is not a directory
at com.xpandit.plugins.xrayjenkins.Utils.FileUtils.getFiles(FileUtils.java:180)
at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.perform(XrayImportBuilder.java:563)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1919)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Build step 'Xray: Results Import Task' marked build as failure
Finished: FAILURE
set up Xray for JIRA Jenkins Plugin;
configured Xray Server/DC integration with Jenkins;
tested connection and it's successful;
went to my Jenkins project configuration and set up 2 post-build Actions:
'Publish TestNG Results'
TestNG XML report pattern: **/target/surefire-reports/testng-results.xml
'Xray:Result Import Task':
Jira Instance: Jira Instance;
Format: TestNG XML;
Execution Report File (file path with file name): **/testng-results.xml (generated by 'Publish TestNG Results' action);
Test Execution Key: JIRA-123 (Jira Test execution issue);

Build step failed with exception using build timeout plugin

I have requirement to implement CI.Following are jenkins configuation details:
Jenkins server 32-bit (window 7)
Maven Integration plugin(version3.0)
Ant Plugin(Version 1.7)
Build Timeout(Version 1.19)
SQLPlus Script Runner( version 1.0.9)
Subversion Plug-in (Version 2.9)
I have following job configutaion:
Configure SVN Repository in Source Code Management step
On Build Environment ->Pre Steps -> using build timeout plugin->Sql script runner for oracle database.
When I executed the job i received following error but if i tried to excute Sql script runner without using build timeout it run smoothly :
ERROR: Build step failed with exception
java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
at hudson.plugins.build_timeout.BuildStepWithTimeout.perform(BuildStepWithTimeout.java:73)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:683)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
at hudson.model.Run.execute(Run.java:1737)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Build step 'Run with timeout' marked build as failure
Finished: FAILURE
I have tried build timeout with ant script same error message is coming.Please suggest.
Thank you.

Using waitForQualityGate in a Jenkins declarative pipeline

The following SonarQube (6.3) analysis stage in a declarative pipeline in Jenkins 2.50 is failing with this error in the console log: http://pastebin.com/t2ja23vC. More specifically:
SonarQube installation defined in this job (SonarGate) does not match any configured installation. Number of installations that can be configured: 1.
Update: after changing "SonarQube" to "SonarGate" in the Jenkins settings (under SonarQube servers, so it'll match the Jenkinsfile), I get a different error: http://pastebin.com/HZZ6fY6V
java.lang.IllegalStateException: Unable to get SonarQube task id and/or server name. Please use the 'withSonarQubeEnv' wrapper to run your analysis.
The stage is a modification of the example from the SonarQube docs: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins#AnalyzingwithSonarQubeScannerforJenkins-AnalyzinginaJenkinspipeline
stage ("SonarQube analysis") {
steps {
script {
STAGE_NAME = "SonarQube analysis"
if (BRANCH_NAME == "develop") {
echo "In 'develop' branch, don't analyze."
}
else { // this is a PR build, run sonar analysis
withSonarQubeEnv("SonarGate") {
sh "../../../sonar-scanner-2.9.0.670/bin/sonar-scanner"
}
}
}
}
}
stage ("SonarQube Gatekeeper") {
steps {
script {
STAGE_NAME = "SonarQube Gatekeeper"
if (BRANCH_NAME == "develop") {
echo "In 'develop' branch, skip."
}
else { // this is a PR build, fail on threshold spill
def qualitygate = waitForQualityGate()
if (qualitygate.status != "OK") {
error "Pipeline aborted due to quality gate coverage failure: ${qualitygate.status}"
}
}
}
}
}
I also created a webhook, sonarqube-webhook, with the URL http://****/sonarqube-webhook/. Should it be like that, or http://****/sonarqube/sonarqube-webhook? To access the server dashboard I use http://****/sonarqube.
In SonarQube's Quality Gates section I created a new quality gate:
I am not sure if the setting in SonarGate is correct. I do use jenkins-mocha to generate an lcov.info file that is used in Sonar to generate the coverage data.
Perhaps the quality gate setting is the wrong setting to do? The end result is to fail the job in Jenkins if coverage % is not met.
Finally, I am not sure if the following configurations in the Jenkins system configuration are at all required:
And
(It's 9000 not 900... cut text in the screen shot)
The SonarQube Jenkins plugin scans the build output for two specific lines, which it uses to get the SonarQube report task properties and project URL. If your invocation of sonar-scanner does not output these lines, the waitForQualityGate() call won't have the task ID to look them up. So you will have to figure out the correct settings to make it more verbose.
See the extractSonarProjectURLFromLogs and extractReportTask methods in the SonarUtils class of the plugin to understand how they work:
ANALYSIS SUCCESSFUL, you can browse <project URL> is used to add a link to the badge (in the build history)
Working dir: <dir with report-task.txt> is used to pass the task ID to the waitForQualityGate step
This was discovered to be a bug in the SonarQube scanner for Jenkins, when using a Jenkins slave for jobs (if the job is run on the master, it'd work). You can read more here: https://jira.sonarsource.com/browse/SONARJNKNS-282
I have tested this using a test build of v2.61 of the scanner plug-in and found it working.
The solution is to upgrade to v2.61 when released.
This stage will then work:
stage ("SonarQube analysis") {
steps {
withSonarQubeEnv('SonarQube') {
sh "../../../sonar-scanner-2.9.0.670/bin/sonar-scanner"
}
def qualitygate = waitForQualityGate()
if (qualitygate.status != "OK") {
error "Pipeline aborted due to quality gate coverage failure: ${qualitygate.status}"
}
}
}
If you're running SonarCube in a docker container check that the memory isn't exhausted. We were maxing out. Which seemed to be the issue.

hudson.AbortException: No files found in path with configured filemask: output.xml

I was running a RobotFramework script using Jenkins and everything was working fine until I accidentally wiped out my current workspace. I don't know how to restore it and now I'm getting the following error:
Robot results publisher started...
-Parsing output xml:
Failed!
hudson.AbortException: No files found in path C:\Users\EEMIZHA\.jenkins\jobs\3PI RF2\workspace with configured filemask: output.xml
at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:77)
at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:54)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.robot.RobotParser.parse(RobotParser.java:49)
at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:217)
at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:239)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Publish Robot Framework test results' changed build result to FAILURE
Finished: FAILURE
I have the robot plugin installed, I've enabled a "Publish Robot Framework test results" post build action, and I'm executing a very simple Windows Batch Command as follows:
cd C:\Users\EEMIZHA\Documents\3PIManager\Testing\
pybot jenkinsConnectionTest.robot
Any ideas?
Fixed by using a custom workspace in Jenkins set to my \path\to\test (under Advanced Project Options/Advanced...). Run pybot command with -d \path\to\test\output-folder parameter and set output-folder as "Directory of Robot output" in Robot Framework post build action.

Jenkins Job Failing - Overwrite to pass Yslow PhantomJS

I have a build that calls Yslow test. The build fails due to some of the yslow tests fail (which I am aware of).
Is there a way to set it so Jenkins does not mark the build "failed" regardless of the yslow tests?
Shell:
/usr/local/bin/phantomjs yslow.js -i grade -t 50 -f junit http://www.website.com > yslow.xml
Console Output:
Build step 'Execute shell' marked build as failure
Recording test results
Finished: FAILURE
You could use the groovyPostbuild plugin for this. Something like the following should work:
if(manager.logContains(".*Build step 'Execute shell' marked build as failure.*")) {
manager.build.#result = hudson.model.Result.SUCCESS
}

Resources