Unable to Publish Cucumber Tests Results, using Jenkins (zephyr scale plugin).
Hi Team,
I am trying to publish cucumber json output to the zephyr scale via tm4j-automation-plugin eventhough file format and content are perfect still not able to publish the results.
[Zephyr Scale] [INFO] Publishing test results... [Zephyr Scale] [ERROR] Error: { "errorCode": 400, "message": "Error parsing the following file(s): /var/jenkins_home/jobs/.json - reason: Invalid value '{\"keyword\"=>\"Scenario\", \"type\"=>\"scenario\", \"description\"=>\"\", \"name\"=>\"Account - GET random account number - /api/Account\", \"tags\"=>[], \"id\"=>\"account-number---cabs---loans-stub;account---get-random-account-number---/api/account\", \"steps\"=>[{\"keyword\"=>\"Before\", \"name\"=>\"\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>20000000}, \"line\"=>nil}, {\"keyword\"=>\"Given\", \"name\"=>\"Channel \\\"OLB\\\"\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>70000000}, \"line\"=>nil}, {\"keyword\"=>\"And\", \"name\"=>\"SourceSystem \\\"OLB\\\"\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>60000000}, \"line\"=>nil}, {\"keyword\"=>\"And\", \"name\"=>\"Set defaults of laoStubs for /accountnumber stub endpoint\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>68000000}, \"line\"=>nil}, {\"keyword\"=>\"When\", \"name\"=>\"a GET /accountnumber request is made to laoStubs mock Api\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>71000000}, \"line\"=>nil}, {\"keyword\"=>\"And\", \"name\"=>\"I verify the stub response status code as \\\"200\\\"\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>2059000000}, \"line\"=>nil}, {\"keyword\"=>\"After\", \"name\"=>\"\", \"result\"=>{\"status\"=>\"passed\", \"duration\"=>1000000}, \"line\"=>nil}]}' at path /0/elements/0. Validation schema used: {\"type\"=>\"object\", \"properties\"=>{\"keyword\"=>{\"type\"=>\"string\"}, \"type\"=>{\"type\"=>\"string\"}, \"id\"=>{\"type\"=>\"string\"}, \"line\"=>{\"type\"=>\"integer\"}, \"name\"=>{\"type\"=>\"string\"}, \"tags\"=>{\"type\"=>\"array\", \"items\"=>{\"$ref\"=>\"#/definitions/tag\"}}, \"steps\"=>{\"type\"=>\"array\", \"items\"=>{\"$ref\"=>\"#/definitions/step\"}}}, \"required\"=>[\"type\", \"line\", \"name\"]}. Details: {\"missing_keys\"=>[\"line\"]}\\nInvalid value '' at path /0/elements/0/steps/0/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/1/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/2/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/3/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/4/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/5/line. Validation schema used: {\"type\"=>\"integer\"}.\\nInvalid value '' at path /0/elements/0/steps/6/line. Validation schema used: {\"type\"=>\"integer\"}." } [Zephyr Scale] [ERROR] Test Cycle was not created [Zephyr Scale] [ERROR] There was an error while publishing test results to Zephyr Scale and they were not sent. Error details: Error when executing always post condition: java.lang.RuntimeException: There was an error while trying to import files to Jira. Http Status Code: 400 at com.adaptavist.tm4j.jenkins.http.Tm4jJiraRestClient.processUploadingResultsResponse(Tm4jJiraRestClient.java:145) at com.adaptavist.tm4j.jenkins.http.Tm4jJiraRestClient.uploadCucumberFile(Tm4jJiraRestClient.java:51) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.uploadResultsFile(TestResultPublisher.java:134) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.validateFieldsAndUploadResults(TestResultPublisher.java:116) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.publishResults(TestResultPublisher.java:95) Caused: java.lang.RuntimeException at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.handlePublishException(TestResultPublisher.java:107) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.publishResults(TestResultPublisher.java:97) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.perform(TestResultPublisher.java:86) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // podTemplate[Pipeline] End of Pipelinejava.lang.RuntimeException: There was an error while trying to import files to Jira. Http Status Code: 400 at com.adaptavist.tm4j.jenkins.http.Tm4jJiraRestClient.processUploadingResultsResponse(Tm4jJiraRestClient.java:145) at com.adaptavist.tm4j.jenkins.http.Tm4jJiraRestClient.uploadCucumberFile(Tm4jJiraRestClient.java:51) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.uploadResultsFile(TestResultPublisher.java:134) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.validateFieldsAndUploadResults(TestResultPublisher.java:116) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.publishResults(TestResultPublisher.java:95) Caused: java.lang.RuntimeException at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.handlePublishException(TestResultPublisher.java:107) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.publishResults(TestResultPublisher.java:97) at com.adaptavist.tm4j.jenkins.extensions.postbuildactions.TestResultPublisher.perform(TestResultPublisher.java:86) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Finished: FAILURE