"Unable to find build script" error running Ant from Jenkins - jenkins

I got this error when running Jenkins to build an Ant project. Could someone explain the source of the problem and how to fix it?
ERROR: Unable to find build script at D:\WORK\06_HRMS\90_SourceCode\trunk\jwf
Recording test results
Injecting SonarQube environment variables using the configuration: Sonar
ERROR: Step ‘Publish JUnit test result report’ aborted due to exception:
java.io.IOException: Failed to read /var/lib/jenkins/workspace/MBFS/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
Is this really a JUnit report file? Your configuration must be matching too many files

Related

Jenkins pipeline to call SonarQube code coverage for node.js project

I am trying to do code coverage for node js project via Jenkins, I’ve one doubt that where to add the “sonar-project.properties” file, it in root repository that means in sonar-scanner installed repository or in the jenkins path i.e. “/var/lib/jenkins/workspace/$JOB_NAME/”,
can some help to fix this I’m getting error while executing the pipeline.
Error log as follows:
/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/sonardemo/bin/sonar-scanner
/var/lib/jenkins/workspace/demosonar#tmp/durable-f32cf5e2/script.sh: 1: /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/sonardemo/bin/sonar-scanner: not found
[Pipeline] }
WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed?

How to build JMeter script using .jmx file in Jenkins

I have created the .jmx scripts for performance testing and I tried to run through those scripts using GUI mode and NOn-GUI mode in the local system using command window and Jmeter tool and it worked fine.But I want to run this scripts in Jenkins remotely using GitHub.
So is there any possible way for me to run the JMeter scripts in Jenkins.
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Build step 'Invoke Artifactory Maven 3' changed build result to FAILURE
Build step 'Invoke Artifactory Maven 3' marked build as failure
Actually it will be the same, you will just need to add a Jenkins build step in order to fetch the .jmx file from Github prior to running JMeter.
For free-style projects it can be configured in GUI
In case of Groovy pipeline it would be something like:
git branch: 'some', credentialsId: 'your_credentials_id', url: 'https://github.com/apache/jmeter'
References:
Jenkins Source Code Management with Git
Jenkins Pipeline Syntax
Continuous Integration 101: How to Run JMeter With Jenkins

ERROR: Error during SonarQube Scanner execution

I have configured Jenkins Job for Sonar Quality Gate and Code Coverage. Below is the Jenkins job set Up. When I trigger the build I see below error. Most of my Jenkins jobs are failing because of this issue. Please help me out from this.
Jenkins Job setup
Error Logs
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error at line 2 of coverage report C:\Location.xml
at org.sonar.plugins.coverage.generic.GenericCoverageSensor.loadReport(GenericCoverageSensor.java:130)
at org.sonar.plugins.coverage.generic.GenericCoverageSensor.analyseWithLogger(GenericCoverageSensor.java:95)
at org.sonar.plugins.coverage.generic.GenericCoverageSensor.analyse(GenericCoverageSensor.java:91)
at org.sonar.plugins.coverage.generic.ReportParser.parse(ReportParser.java:82)
at org.sonar.plugins.coverage.generic.GenericCoverageSensor.loadReport(GenericCoverageSensor.java:126)
... 31 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
21:44:09.12 Creating a summary markdown file...
21:44:09.122 Post-processing failed. Exit code: 1
The answer is there in the log:
org.sonar.plugins.dotnet.tests.ParseErrorException: Missing root element 'test-results' in C:\UC\ProductEligibility\BTS\results.xml at line 2
So the results.xml is not valid xml and causes a parse error and kills the analysis. So whatever creates that file, is causing the issue in the end.
Try to remove that parameter to verify if the analysis runs correctly now.

Error in Executing Jobs on Slave In Jenkins

I have Master Slave configuration under Jenkins.I wanted to run a job on the slave system under Jenkins I order to do that I have copied the required scripts and files But I have been getting the following error
Started by user anonymous
[EnvInject] - Loading node environment variables.
Building remotely on MySlave in workspace C:\Users\prathamesh.n\workspace\MasterSlave
FATAL: Cannot find executable from the chosen Ant installation "apache-ant-1.9.4"
Build step 'Invoke Ant' marked build as failure
Archiving artifacts
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level C:\Users\sudharshan.r\workspace\Ant\exec\reports\Test 1 to C:\Users\sudharshan.r.jenkins\jobs\Project 11\htmlreports\HTML_Report
ERROR: Specified HTML directory 'C:\Users\sudharshan.r\workspace\Ant\exec\reports\Test 1' does not exist.
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: C:/Users/sudharshan.r/workspace/Ant/exec/reports/Test 1/testng-results.xml
Did not find any matching files.
[BFA] Scanning build for known causes...
[BFA] Done. 0s
Finished: FAILURE
need help on executing ant on slave
Click on Jenkins - > Manage Jenkins -> configure system -> Under Ant, define your installer and then in your job select that ant configuration.
Whats your configuration in your build? Default or let's assume my 1.9.
Now in "configure jenkins": Add a specific ant e.g. with name my 1.9.
easiest way is automatic installation and installation from Apache
if you don't want to do this: uncheck automatic installation and give your path were you installed ant in the field: ANT_HOME

Gatling plugin for Jenkins without pom.xml

Has anyone tried to use gatling plugin for jenkins, but without maven? I don't have maven project, but I generate results using Gatling from terminal (bash script). Using -rf switch I change results folder destination to /var/lib/jenkins/jobs/Gatling_test/builds/newest_build/results, but anyway there is error:
Archiving Gatling reports...
ERROR: Publisher com.excilys.ebi.gatling.jenkins.GatlingPublisher aborted due to exception
java.lang.IllegalArgumentException: Could not find a Gatling report in results folder.
at com.excilys.ebi.gatling.jenkins.GatlingPublisher.saveFullReports(GatlingPublisher.java:97)
at com.excilys.ebi.gatling.jenkins.GatlingPublisher.perform(GatlingPublisher.java:65)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Finished: FAILURE
Build just run shell script, and post-build action is set to Track a Gatling load simulation.
Thanks for any suggestions.
I think that you should send your results into the workspace of the job, not the job itself.
In the code the plugin looks for results in the workspace of the build.
Hope this helps!

Resources