maplesteve / JiraTestResultReporter

A plug-in for Jenkins that creates issues in Jira for failed unit tests.
MIT License
2 stars 56 forks source link

Getting Error in Json file #6

Closed Nijisha closed 8 years ago

Nijisha commented 9 years ago

Hi I am trying with this plugin but getting some other error like [JiraTestResultReporter] [DEBUG] ----------------------------java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1][JiraTestResultReporter] [INFO] Done.Finished: SUCCESSthe issue is not updating to my JIRA my configurations1. jenkins version 1.598 (this is my master server on ubuntu)2. created windows slave machine (2008 R2 server)3. running my testcases in the slave machine, which is a windows batch file (automated testcase with Selenium webdriver and TestNG).4. run this batch file in build step as windows batch file5. in post build step configured xUnit( version 1.96) plugin and selected jUnit and gave the output file from the build step.6. again configured post build step with JiraTestResultReporter (version 1.0.5-SNAPSHOT-Here) plugin for pushing the failed test case into my JIRA server.in step 6 I am facing issue. HiCapture.PNG I am trying with this plugin but getting some other error like

[JiraTestResultReporter] [DEBUG] ---------------------------- java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1] [JiraTestResultReporter] [INFO] Done. Finished: SUCCESS the issue is not updating to my JIRA my configurations with Jenkins

  1. jenkins version 1.598 (this is my master server on ubuntu)
  2. created windows slave machine (2008 R2 server)
  3. running my testcases in the slave machine, which is a windows batch file (automated testcase with Selenium webdriver and TestNG).
  4. run this batch file in build step as windows batch file
  5. in post build step configured xUnit( version 1.96) plugin and selected jUnit and gave the output file from the build step.
  6. again configured post build step with JiraTestResultReporter (version 1.0.5-SNAPSHOT-Here) plugin for pushing the failed test case into my JIRA server. in step 6 I am facing issue. My configuration with Jira
  7. created a JIRA free trail account.
  8. created a project in JIRA. my errorlist Started by user anonymous Building remotely on testSelenium in workspace C:\SeleniumTest\workspace\testwithJira [xUnit] [INFO] - Starting to record. [xUnit] [INFO] - Processing JUnit [xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern '**/TEST-CallingTestSuite.xml' relative to 'C:\SeleniumTest\workspace\testwithJira' for the testing framework 'JUnit'. [xUnit] [INFO] - Converting 'C:\SeleniumTest\workspace\testwithJira\test-output\junitreports\TEST-CallingTestSuite.xml' . [xUnit] [INFO] - Check 'Failed Tests' threshold. [xUnit] [INFO] - Check 'Skipped Tests' threshold. [xUnit] [INFO] - Setting the build status to SUCCESS [xUnit] [INFO] - Stopping recording. [JiraTestResultReporter] [INFO] Examining test results... [JiraTestResultReporter] [DEBUG] Build result is SUCCESS [JiraTestResultReporter] [DEBUG] [JiraTestResultReporter] [INFO] Workspace is C:\SeleniumTest\workspace\testwithJira [JiraTestResultReporter] [DEBUG] projectKey: TEST [JiraTestResultReporter] [DEBUG] errorDetails: test failure [JiraTestResultReporter] [DEBUG] fullName: callSuiteForFirefox.errorcreating [JiraTestResultReporter] [DEBUG] simpleName: callSuiteForFirefox [JiraTestResultReporter] [DEBUG] title: Case Result: errorcreating [JiraTestResultReporter] [DEBUG] packageName: (root) [JiraTestResultReporter] [DEBUG] name: errorcreating [JiraTestResultReporter] [DEBUG] className: callSuiteForFirefox [JiraTestResultReporter] [DEBUG] failedSince: 102 [JiraTestResultReporter] [DEBUG] status: FAILED [JiraTestResultReporter] [DEBUG] age: 1 [JiraTestResultReporter] [DEBUG] ErrorStackTrace: creation failed [JiraTestResultReporter] [DEBUG] affectedFile: creation failed [JiraTestResultReporter] [DEBUG] ---------------------------- java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1] java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1] [JiraTestResultReporter] [INFO] Done. Finished: SUCCESS and this is my generated xml file for the test case <?xml version="1.0" encoding="UTF-8"?> <!- Generated by org.testng.reporters.JUnitReportReporter -> creation failed

Is there any format do I need to follow for xml file? which test I need to select from xUnit plugin for selenium testcase(webdriver+TestNg) output (I selected junit test).

Thanks in advance...

nesreenibrahim commented 8 years ago

HI i'm trying the same and i'm not able to do it can you please help

maplesteve commented 8 years ago

@Nijisha Sorry, but I have no idea why this happens. Did you examine, what the XML looks like at the position mentioned in the error? Nevertheless, you should try to upgrade to version 2 of this plugin, which got a lot of new functionality and is actively supported. Please see the plugin page here.

Nijisha commented 8 years ago

@ Maplesleve, I tried this using the trial version of JIRA. It may cause the reason. And other things I was not using the Selenium plugin. I ran the testcases using my own Java application. I resolved the issue. I called REST API for Jira from my java application and passed the failed test case as an argument.