I created a yaml file and I would like to run Taurus test using Jenkinsfile.
I tried with these :
stage("run test") {
bzt "stepping.yml"
}
But i am receiving an error regarding bzt.
It would be better if you show an error message
BTW, You can also check these to guide you to integrate Jenkins with Taurus
https://gettaurus.org/kb/Jenkins/
https://www.blazemeter.com/blog/how-run-taurus-test-through-jenkins-pipelines
Related
I recently tried to add a "Publish test results" step within my Jenkins pipeline, but was wondering where to see/retrieve the TestResults.xml file that should be generated while deploying.
For reference, here's the code I'm using, straight from the documentation:
stage("Publish NUnit Test Report") {
steps {
nunit testResultsPattern: 'TestResult.xml'
}
}
Thanks a lot for your help!
I defined a Jenkins Declarative pipeline to CI/CD my project. I am using gradle as my build tool. However I don't want to use the Gradle Wrapper and check it int the VCS. So I planed on using the jenkins tools functionality as below so that I can update the version number if I need to in future. But it doesn't seem to work.
pipeline {
agent any
tools {
gradle "gradle-4.0"
}
stage("Compile") {
steps {
sh 'gradle project/build.gradle classes'
}
}
I get the error "script.sh: gradle: not found".
I tried to echo PATH and that doesn't contain the path of this autoinstalled gradle tool. Please help.
Looks like there is an issue on the gradle plugin for Jenkins on plugin version 1.26. Please see the link to the bug reported below.
https://issues.jenkins-ci.org/browse/JENKINS-42381
Trying to use the nifty Jenkins Pipeline, I had problems finding out how to publish NUnit test results.
I am able to run the tests by specifying the following command in the pipeline script:
stage 'Test'
bat '"C:\\Program Files (x86)\\NUnit 2.6.4\\bin\\nunit-console-x86.exe" "ProjectName\\bin\\Release\\UnitTests.net.dll"'
But how to make Jenkins "publish" the test results is not obvious. The Snippet Generator only suggests junit, and that does not seem to work.
I used nunit plugin version 0.21 and was able to publish results using
stage("PublishTestReport"){
nunit testResultsPattern: 'TestResult.xml'
}
(TestResult.xml is at the root of jenkins workspace in this above example)
Investigating the NUnit plugin for Jenkins led me on to this issue, where I found the solution:
step([$class: 'NUnitPublisher', testResultsPattern: 'TestResult.xml', debug: false,
keepJUnitReports: true, skipJUnitArchiver:false, failIfNoResults: true])
Adding this to the pipeline script worked for me!
However, it seemed the following should also work (but at the present, apparently, it does not): Using the Snippet Generator, select this:
step: General Build Step
Publish NUnit test result report
This generates the following in the Pipeline script:
step <object of type hudson.plugins.nunit.NUnitPublisher>
This fails!
I am creating a CI/CD pipeline. I am trying to create a groovy function in order to deploy a build to udeploy.
I know I will need to pass the parameters used in to the function such as:
udeployServer,
component,
artifactDirectory,
version,
deployApplication,
environment and
deployProcess.
I was wondering has anyone tried to implement this or has anyone any idea how I should approach this?
Thanks
I don't know anything about udeploy servers but I do know there is no pipeline plugin for udeploy, which means that you will not have a function such as :
udeploy: server=yourserver component=yourcomponent artifactDirectory=...
However Jenkins allow you to use shell commands inside your groovy pipeline, so you should be able to do pretty much everything you need. So I guess the real question is how do you usually deploy a build to udeploy ? Do you do it via a REST API, do you push a file via FTP, ... ?
Jenkins build will be pretty straightforward, have a look at how to checkout and build using Jenkins pipeline.
An example pipeline could look like :
{
stage 'Build'
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn clean install"
//... Some other stages as needed...
stage 'Deploy'
sh "execute sh deploy script here..."
}
... where you deploy stage could use other plugins to copy files to your server, run REST API requests, etc. While writing a pipeline, have a look at Pipeline Syntax link for a Snippet Generator giving more detailed information about existing plugins.
It looks like support for test results analyzer was added to the pipeline plugin from the jira issue below. I'm having trouble figuring out how to acutally implement the plugin using a pipeline script.
https://issues.jenkins-ci.org/browse/JENKINS-30522
Regardless of the jira issue, how can I run the test results analyzer through my pipeline?
When you add test reports to your pipeline script this works automatically. The "Test Results Analyzer" button shows up right away for jobs that have tests, including those that use the pipeline plugin.
For example when using the standard "junit" report plugin like this, it should work out of the box:
stage('Unit tests') {
steps {
sh 'unit-tests.sh'
}
post {
always {
junit 'path/to/report.xml'
}
}
}