jenkinsci / cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
https://plugins.jenkins.io/cucumber-reports/
GNU Lesser General Public License v2.1
210 stars 232 forks source link

Error ValidationException - JsonSyntaxException with gherkin-language #41

Closed leonbsilva closed 8 years ago

leonbsilva commented 8 years ago

Hi!

I'm trying to access 'cucumber-jvm reports' link on Jenkins and it shows this error message:

net.masterthought.cucumber.ValidationException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:41) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:47) 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.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) 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:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) 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:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) 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:879) at com.google.gson.Gson.fromJson(Gson.java:817) at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:33) ... 11 more Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 449 path $[0].elements[0].before[0].match.location at com.google.gson.stream.JsonReader.nextString(JsonReader.java:831) 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:116) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) ... 26 more

Trying to generate report from following files. Make sure they are valid cucumber report files:

The file was generated using the shell step with the command: cucumber -f pretty -f json -o cucumber.json

The generated json file is here: cucumber.json.zip

I'm using gherkin-language to write cucumber features in pt.

Jenkins Version: 1.654 Cucumber-jvm reports plugin: 2.0.0

Anyone knows what is going on?

damianszczepanik commented 8 years ago

Duplicate of damianszczepanik/cucumber-reporting/pull/316