Closed wendywww closed 5 years ago
@eroshenkoam @baev Could you please take a look at this issue? Thank you:)
@baev I tried global tools configuration in 1) maven auto install and 2) zip file install, none of those are successful. The error has listed above, seems like after run all the test the allure command line was trying to install but while look up the downloaded file, it cannot find the executable file(allure2.6->bin->allure executable file).
The observation is similar as #163 and all related to Jenkins Pipeline job set up. I have included the corresponding pipeline file above. Please take a look.
pipeline {
agent any
options {
timestamps()
timeout(time: 2, unit: 'HOURS')
}
environment {
JOB_USER = getJobUsername()
}
parameters {
string(defaultValue: 'end_to_end_all_browsers', description: 'Test suite', name: 'testSuite')
}
stages {
stage('Set description') {
steps {
script {
currentBuild.description = "${params.testOrg}: ${params.testSuite} on ${params.testBrowser}"
}
}
}
stage('Run tests') {
agent {
docker {
image 'sagan/selenium:3.10.0-argon'
args '-v /dev/shm:/dev/shm -u root --ulimit nofile=8000:8000' // otherwise Chrome crashes running out of memory, or SauceLabs complains
registryUrl 'https://registry.hub.docker.com'
registryCredentialsId 'dockerHub'
}
}
post {
always {
archiveArtifacts allowEmptyArchive: true, artifacts: 'integration/logs/*.*'
archiveArtifacts allowEmptyArchive: true, artifacts: 'integration/shots/*.*'
junit 'integration/logs/*.xml'
//allure([includeProperties: false, jdk: '', properties: [[key: 'variant', value: '${VARIANT}']], reportBuildPolicy: 'ALWAYS',results: [[path: 'allure-results']]])
allure results: [[path: 'allure-results']]
//cleanWs()
}
}
steps {
// clone build-harness
checkout([$class: 'GitSCM', branches: [[name: 'origin/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'build-harness']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/sagansystems/build-harness.git']]])
// workaround for https://issues.jenkins-ci.org/browse/JENKINS-41316
sh '''
nohup /opt/bin/entry_point.sh &
sleep 10
'''
sshagent(['saganbotSSH']) { // need SSH to fetch private deps
sh 'make -C integration deps'
}
// run tests
sh 'make -C integration test-suite'
}
}
}
}
@wendywww ty, I will look at this tomorrow
pipeline {
agent { ... }
stages {
stage('Run tests') {
agent {
docker {
reuseNode true
image 'maven'
}
}
steps {
checkout([$class: 'GitSCM', branches: [[name: 'origin/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/allure-examples/allure-junit-example']]])
sh 'mvn clean test -Dmaven.test.failure.ignore=true'
stash name: 'allure-results', includes: 'target/allure-results/*' // save results
}
}
}
post {
always {
unstash 'allure-results' //extract results
allure results: [[path: 'target/allure-results']]
}
}
}
@wendywww please test it
You need to use stash-unstash
feature in this case.
With this feature the problem will be solved.
Thank you @eroshenkoam This is the current error i am having after add stash-unstash in my .jenkins file.
@wendywww You need to split test run and report build. Jenkins isn't support tools inside docker container agent.
So what you should do:
pipeline {
agent ... //this is common agent
stages {
stage("Run tests") {
agent { docker ... } //only for tests
steps {
// run your test
// save results
}
}
stage("Build report") { // 1. You can build allure report here
agent { ... } //not docker
steps {
//unpack test results
//build allure report
}
}
}
post { // 2. Or you can build report here
always {
//unpack test results
//build allure report
}
}
}
@eroshenkoam I tried both the options you suggested, but I am still getting the same errors. This seems from the
java.nio.file.AccessDeniedException:/home/ec2-user/workspace/test-allure-integration@2/integration/allure-results/0008a34b-9c30-4e6b-ba93-84993298ebda-attachment.json
and
Also:hudson.remoting.Channel$CallSiteStackTrace: Remote call to slaves.jenkins-dev.mertslounge.ca (i-0b669f80dc65c18b3)
I have attached the detailed error message here. error_2.txt
@eroshenkoam I am not able to unstash the allure-results successful, which doesn't feed data to the allure report. I think it's very close, do you have any suggestion on how to make unstash work? (as you suggested, the unstash is under agent any
post {
always{
unstash 'allure-results' //unpack test results
script {
allure results: [[path: 'integration/allure-results']]
}
}
}
by adding the script snippet script { allure results: [[path: 'integration/allure-results']] }
the report is able to read the data from the results. Hope this help others who's in same issue
@eroshenkoam you can close this issue as we have resolved it long time back, thank you.
Hi @eroshenkoam / @wendywww , I'm facing this issue in my current project and May I know the exact workaround step by step please
pipeline { agent { docker { image 'mcr.microsoft.com/playwright:v1.47.0-noble' } } tools {nodejs "22.8.0" }
stages {
stage('Test') {
steps {
sh '''
npm install
npx playwright install
npx playwright test -g "@rewards" --workers=1
stash name: 'allure-results', includes: 'target/allure-results/*
allure generate allure-results -o allure-report --clean
npx allure serve allure-results
'''
}
post {
always {
unstash 'allure-results'
allure includeProperties:
false,
jdk: '',
results: [[path: 'build/allure-results']]
}
}
}
}
}
This is my jenkins file for your reference
when install allure-plugin through jenkins piplin, got error message as" No such file or directory ./AllureCommandline/bin/allure"
Context
Jenkins version: Jenkins ver. 2.111
Job type: Pipeline
Allure plugin version: 2.26.0
Allure commandline version: it's installed through the global tool setting, by maven central v2.6.0
Problem description
Describe your problem in a meaningful way:
Screen shot for commandline installer from global tools setting
Logs & Traces
Error messages:
Under wdio.config
package-lock.json
package.json
"devDependencies": "wdio-allure-reporter": "^0.6.1"
jenkins file for pipline script:
Please help resolve this issue ASAP. Thanks!