Forum Discussion

MG_SSG's avatar
MG_SSG
Regular Visitor
2 years ago

Getting permission error trying to upload tests/results to scale via jenkins plugin

Have recently moved to using scale as our core test management system, previously tests were only managed via Feature files in our automated framework.

Along with bringing in Zephyr scale I have implemented and installed the Scale plugin for Jenkins. 

 

I have added some code in my Jenkins file to try and upload tests to Scale on execution ( not doing custom test cycles yet) as a stage (POST) when test runs are completed.

 

stage("Post"){
              steps {
                  script{
                         publishTestResults serverAddress: 'https://XXXXXXXXX.atlassian.net',
                                      projectKey: 'JTEST',
                                      format: 'Cucumber',
                                      filePath: 'test-report/json/*.json',
                                      autoCreateTestCases: true

                  }
              }
      }

As you can see I have stripped the jenkins code right back to only upload test (not create cycles) yet.

 

 I can see in my console output on Jenkins that the Jira instance is being connected to but I am seeing a failure error around directory permissions.

Zephyr Scale] [INFO] Publishing test results...
[Zephyr Scale] [ERROR] There was an error trying to publish test results to Zephyr Scale. Error details: 
 com.adaptavist.tm4j.jenkins.cucumber.CucumberFileProcessor.filterCucumberFile(CucumberFileProcessor.java:43)  
 com.adaptavist.tm4j.jenkins.cucumber.CucumberFileProcessor.filterCucumberFile(CucumberFileProcessor.java:24)  
 java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)  
 java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)  
 java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)  
 java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)  
 java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)  
 java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)  
 java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)  
 com.adaptavist.tm4j.jenkins.io.FileReader.getJsonCucumberZip(FileReader.java:35)  
 com.adaptavist.tm4j.jenkins.http.Tm4jJiraRestClient.uploadCucumberFile(Tm4jJiraRestClient.java:38)  
 com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.perform(TestResultPublisher.java:87)  
 com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.perform(TestResultPublisher.java:67)  
 jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)  
 org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)  
 org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)  
 org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)  
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
 java.util.concurrent.FutureTask.run(FutureTask.java:266)  
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
 java.lang.Thread.run(Thread.java:748)  
 The directory '/var/lib/jenkins/jobs/XXXX/jobs/QA/jobs/Core/jobs/BS-Scale-Test/builds/24/target/cucumber_tmp/' couldn't be created. Please check folder permissions and try again  
[Zephyr Scale] [ERROR] Tests results have not been sent to Zephyr Scale 


I have spoken at length with our DevOps team and there response is 
"No good reason it should be trying to create anything on that path, as your Jenkins node doesn't run under that directory, so quite right it got permissions denied."

 

Can anyone point me in a direction that might explain why the plugin is trying to push something to a directory outside of my Jenkins Node and how I might get around it.

Jira is a cloud instance

Tech Stack (if relevant)

Node 12.9.3

Webdriver IO 7.7.5

wdio-cucumberjs-json-reporter-4.4.1

@wdio/cucumber-framework 7.7.5

No RepliesBe the first to reply