damianszczepanik / cucumber-reporting-jenkins

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

Error while generating report #17

Closed Rejjn closed 12 years ago

Rejjn commented 12 years ago

I get the following error when generating the HTML reports:

Building remotely on pub-testdriver in workspace /opt/jenkins-slave/workspace/Systemtest - DrFront
Checkout:Systemtest - DrFront / /opt/jenkins-slave/workspace/Systemtest - DrFront - hudson.remoting.Channel@1d8dd769:pub-testdriver
Using strategy: Default
Last Built Revision: Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master)
Checkout:Systemtest - DrFront / /opt/jenkins-slave/workspace/Systemtest - DrFront - hudson.remoting.LocalChannel@23364534
Fetching changes from 1 remote Git repository
Fetching upstream changes from ssh://n06523@nrklx56021/opt/git-repos/cucumber.git
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master)
Checking out Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[Systemtest - DrFront] $ /bin/sh -xe /tmp/hudson6653976864463069602.sh
+ cd '/opt/jenkins-slave/workspace/Systemtest - DrFront'
+ ./bin/run_ci_tests.sh ci drfront
....

20 scenarios (20 failed)
69 steps (20 failed, 29 skipped, 20 passed)
0m0.170s
Build step 'Execute shell' marked build as failure
Archiving artifacts
Recording test results
[CucumberReportPublisher] Compiling Cucumber Html Reports ...
[CucumberReportPublisher] detected this build is running on a slave 
[CucumberReportPublisher] copying json from: file:/opt/jenkins-slave/workspace/Systemtest%20-%20DrFront/to reports directory: file:/home/tomcat/.hudson/jobs/Systemtest%20-%20DrFront/builds/2012-06-11_13-28-18/cucumber-html-reports/
[CucumberReportPublisher] Generating HTML reports
ERROR: Publisher net.masterthought.jenkins.CucumberReportPublisher aborted due to exception
java.lang.NullPointerException
    at net.masterthought.jenkins.FeatureReportGenerator.getAllStepStatuses(FeatureReportGenerator.java:332)
    at net.masterthought.jenkins.FeatureReportGenerator.<init>(FeatureReportGenerator.java:38)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:96)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:678)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:656)
    at hudson.model.Build$RunnerImpl.post2(Build.java:162)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:625)
    at hudson.model.Run.run(Run.java:1435)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Finished: FAILURE

I'm using 0.0.11 (I think, or at least that is what my plugin manager tells me) on jenkins 1.456.

kingsleyh commented 12 years ago

hi - email me your cucumber.json file and I will take a look. (kingsley@mindflowsolutions.com)

On 11 Jun 2012, at 12:33, Fredrik Rinman wrote:

I get the following error when generating the HTML reports:

Building remotely on pub-testdriver in workspace /opt/jenkins-slave/workspace/Systemtest - DrFront Checkout:Systemtest - DrFront / /opt/jenkins-slave/workspace/Systemtest - DrFront - hudson.remoting.Channel@1d8dd769:pub-testdriver Using strategy: Default Last Built Revision: Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master) Checkout:Systemtest - DrFront / /opt/jenkins-slave/workspace/Systemtest - DrFront - hudson.remoting.LocalChannel@23364534 Fetching changes from 1 remote Git repository Fetching upstream changes from ssh://n06523@nrklx56021/opt/git-repos/cucumber.git Seen branch in repository origin/HEAD Seen branch in repository origin/master Commencing build of Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master) Checking out Revision 51f3976ca5721f369b519b9b33dead1ac76e1e09 (origin/HEAD, origin/master) Warning : There are multiple branch changesets here [Systemtest - DrFront] $ /bin/sh -xe /tmp/hudson6653976864463069602.sh

  • cd '/opt/jenkins-slave/workspace/Systemtest - DrFront'
  • ./bin/run_ci_tests.sh ci drfront ....

20 scenarios (20 failed) 69 steps (20 failed, 29 skipped, 20 passed) 0m0.170s Build step 'Execute shell' marked build as failure Archiving artifacts Recording test results [CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on a slave [CucumberReportPublisher] copying json from: file:/opt/jenkins-slave/workspace/Systemtest%20-%20DrFront/to reports directory: file:/home/tomcat/.hudson/jobs/Systemtest%20-%20DrFront/builds/2012-06-11_13-28-18/cucumber-html-reports/ [CucumberReportPublisher] Generating HTML reports ERROR: Publisher net.masterthought.jenkins.CucumberReportPublisher aborted due to exception java.lang.NullPointerException at net.masterthought.jenkins.FeatureReportGenerator.getAllStepStatuses(FeatureReportGenerator.java:332) at net.masterthought.jenkins.FeatureReportGenerator.(FeatureReportGenerator.java:38) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:96) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:678) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:656) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:625) at hudson.model.Run.run(Run.java:1435) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Finished: FAILURE

I'm using 0.0.11 (I think, or at least that is what my plugin manager tells me) on jenkins 1.456.


Reply to this email directly or view it on GitHub: https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/issues/17

kingsleyh commented 12 years ago

Hi

This is now fixed in the 0.0.12 release which I have just put in the downloads section. The reason was some scenarios did not have steps - so now the plugin tries to gracefully handle when there are no scenarios or no steps.

Rejjn commented 12 years ago

Great! Will download the new version and verify.

hgontijo commented 12 years ago

Hi,

I'm getting the same issue - please see below console output. The build is running on a slave and the json was properly copied to master. I setup an another Jenkins instance - single node without slaves, setup a fake job to create cucumber reports, used the same json files and it worked well. Not sure if it's related.

Using v0.0.12.

Any clues on that?

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] detected this build is running on a slave [CucumberReportPublisher] copying json from: file:/opt/jenkins_home/workspace/mvp1-acceptance-tests/to reports directory: file:/opt/jenkins_home/jobs/mvp1-acceptance-tests/builds/2012-09-21_10-32-05/cucumber-html-reports/ [CucumberReportPublisher] Generating HTML reports ERROR: Publisher net.masterthought.jenkins.CucumberReportPublisher aborted due to exception com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 at com.google.gson.Gson.fromJson(Gson.java:802) at com.google.gson.Gson.fromJson(Gson.java:757) at com.google.gson.Gson.fromJson(Gson.java:706) at com.google.gson.Gson.fromJson(Gson.java:678) at net.masterthought.jenkins.FeatureReportGenerator.parseJsonResults(FeatureReportGenerator.java:54) at net.masterthought.jenkins.FeatureReportGenerator.(FeatureReportGenerator.java:36) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:96) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:697) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:672) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:997) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:619) at hudson.model.Run.run(Run.java:1429) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 at com.google.gson.stream.JsonReader.expect(JsonReader.java:339) at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:306) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70) at com.google.gson.Gson.fromJson(Gson.java:791) ... 15 more Notifying upstream projects of job completion Finished: FAILURE

Thanks,

peacetrader commented 10 years ago

I got the same error..then fixed it by updating the version of the cucumber report plugin... Alternatively you can copy paste your json file in this and see if that generates the report... http://cucumber-reporting.masterthought.net/

this is the the link to download the plugin... https://wiki.jenkins-ci.org/display/JENKINS/Cucumber+Reports+Plugin