damianszczepanik / cucumber-reporting-jenkins

Java jenkins plugin for cucumber-jvm reporting
151 stars 12 forks source link

Cant view reports (com.google.gson.JsonSyntaxException: java.lang.IllegalStateException:) #61

Closed gminator closed 8 years ago

gminator commented 11 years ago

I cant view the reports after its been generated. I get this error when following the Cucumber report link http://host:8080/job/PROJECT/140/cucumber-html-reports/? com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2

Here is my console output [CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on a slave [CucumberReportPublisher] copying json from: file:/home/myrsaweb/workspace/PROJECT/to reports directory: file:/var/lib/jenkins/jobs/PROJECT/builds/2013-05-06_11-25-59/cucumber-html-reports/

Pleas help I've been bashing my head for 2 days now... I don't have an issue with multiple json files. This is what the plugin generates, results.json is the only json file I have and it looks like its being copied from my Jenkins Slave Node correctly $ ls -1 blue charts feature-overview.html results.json velocity.log

kingsleyh commented 11 years ago

Hi

This error is with the gson library and seems to pop up now and again.

Can you tell me what version of java you are running?

Also you could try to delete the gson directories in your .m2 repository so that maven fetches the gson library again in case there is a problem there.

The next release will have an updated gson library so that may help.

Next release will be soon

Sent from my iPhone

On 6 May 2013, at 10:35, Giovann notifications@github.com wrote:

I cant view the reports after its been generated. I get this error when following the Cucumber report link http://host:8080/job/PROJECT/140/cucumber-html-reports/? com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2

Here is my console output [CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on a slave [CucumberReportPublisher] copying json from: file:/home/myrsaweb/workspace/PROJECT/to reports directory: file:/var/lib/jenkins/jobs/PROJECT/builds/2013-05-06_11-25-59/cucumber-html-reports/

Pleas help I've been bashing my head for 2 days now... I don't have an issue with multiple json files. This is what the plugin generates, results.json is the only json file I have and it looks like its being copied from my Jenkins Slave Node correctly $ ls -1 blue charts feature-overview.html results.json velocity.log

— Reply to this email directly or view it on GitHub.

gminator commented 11 years ago

I'm using OpenJDK java version "1.6.0_24" On Jenkins1.512

I'm also using the Ruby Cucumber to generate my json report.

damianszczepanik commented 9 years ago

Can you reproduce the problem with recent version?

hojbota commented 8 years ago

Hello, I managed to reproduce this with version 1.3.0 of the plugin, java version: java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

The error message (if any) is below:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 679 path $[0].elements[0].before[0].match.location at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:861) at com.google.gson.Gson.fromJson(Gson.java:799) at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:35) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:48) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 679 path $[0].elements[0].before[0].match.location at com.google.gson.stream.JsonReader.nextString(JsonReader.java:838) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) ... 26 more

Trying to generate report from following files. Make sure they are valid cucumber report files: /Users/sergiuhojbota/.jenkins/jobs/e2e_test/builds/18/cucumber-html-reports/Yieldify-Testing/ruby/projects/yieldify_control_e2e/reports/feature_report.json

damianszczepanik commented 8 years ago

Attach json file

hojbota commented 8 years ago

feature_report.json.zip

damianszczepanik commented 8 years ago

@tommywo is working on this in damianszczepanik/cucumber-reporting/pull/316