Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27731

Exception while parsing result file

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Jenkins 1.607, macOS 10.10.2, cucumber son test reporting plugin 0.7

    Description

      This is the error i got in the console for the job when it tried to parse the attached json file.

       
      [Cucumber Tests] Parsing results.
      [Cucumber Tests] parsing cucumber.json
      ERROR: Build step failed with exception
      java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String
      	at gherkin.JSONParser.step(JSONParser.java:131)
      	at gherkin.JSONParser.parse(JSONParser.java:51)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:94)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:44)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:161)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:107)
      	at hudson.FilePath.act(FilePath.java:989)
      	at hudson.FilePath.act(FilePath.java:967)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:101)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:116)
      	at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:93)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:374)
      Build step 'Publish Cucumber test result report' marked build as failure
      

      Attachments

        Activity

          teilo James Nord added a comment -

          The official Gherkin parser is saying your json is not valid.
          What tool and version did you use to generate this?

          teilo James Nord added a comment - The official Gherkin parser is saying your json is not valid. What tool and version did you use to generate this?

          I'm using calabash 0.14.0 for iOS
          And this is the command i use:
          cucumber test/cucumber -f junit -o ../../build/cucumberTests/ --tags @working -v

          otusweb olivier destrebecq added a comment - I'm using calabash 0.14.0 for iOS And this is the command i use: cucumber test/cucumber -f junit -o ../../build/cucumberTests/ --tags @working -v

          I'm getting the same error message when trying to parse a JSON file generated by Cucumber 2.0.0. Any way to find out what part of the file is supposedly invalid?

          dserodio Daniel Serodio added a comment - I'm getting the same error message when trying to parse a JSON file generated by Cucumber 2.0.0. Any way to find out what part of the file is supposedly invalid?

          For debugging save final json, create job that will have this json in workspace, do "touch this.json" to update file metadata. And then start cutting pieces of steps in this json. According to trace issue will be somewhere in step that contains Double number.

          integer Kanstantsin Shautsou added a comment - For debugging save final json, create job that will have this json in workspace, do "touch this.json" to update file metadata. And then start cutting pieces of steps in this json. According to trace issue will be somewhere in step that contains Double number.
          teilo James Nord added a comment -

          "output" should be a string - but you have a number - bug in the tooling you are using - please file upstream.

          "output": [
          136
          ],

          teilo James Nord added a comment - "output" should be a string - but you have a number - bug in the tooling you are using - please file upstream. "output": [ 136 ],
          teilo James Nord added a comment -

          was this filed upstream - did it get fixed?

          teilo James Nord added a comment - was this filed upstream - did it get fixed?

          People

            teilo James Nord
            otusweb olivier destrebecq
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: