jenkinsci / cucumber-living-documentation-plugin

https://plugins.jenkins.io/cucumber-living-documentation/
https://plugins.jenkins.io/cucumber-living-documentation/
MIT License
15 stars 11 forks source link

Features are not found #2

Closed tfnico closed 8 years ago

tfnico commented 8 years ago

I've got a job configured like this:

Features dir: build/cucumber-results

During the build, the cucumber.json and *.feature files are generated/copied into the above directory.

Here's the output of running only the plugin in the workspace:

Building in workspace /usr/share/tomcat7/.jenkins/workspace/webtest-testing
Fetching changes from the remote Git repository
Checking out Revision c42cbd4c99823486393d1309c29ce3c6c874adc2 (detached)

Generating living documentation for webtest-testing with the following arguments: 
Features dir: /usr/share/tomcat7/.jenkins/workspace/webtest-testing/build/cucumber-results
Format: all
Toc: left
Title: Features
Numbered: true
Section anchors: true

No features Found in /usr/share/tomcat7/.jenkins/jobs/webtest-testing/builds/10/build/cucumber-results. 
Living documentation will not be generated.
Finished: SUCCESS

Here is what is in those dirs:

ls -1 /usr/share/tomcat7/.jenkins/workspace/webtest-testing/build/cucumber-results
cucumber.json

And:

ls -1 /usr/share/tomcat7/.jenkins/workspace/webtest-testing/build/cucumber-results
1560_access.feature
1561_user_account.feature
1613_insert.feature
1639_preview.feature
1697_display.feature
cucumber.json
formatter.js
index.html
jquery-1.8.2.min.js
report.js
style.css

It is a tad confusing that the plugin says it is using Features dir in the workspace, but actually looks for feature files in the job/build directory. Strangely enough, when I manually copy the features into the job/build directory, it still doesn't work.

I also do find it confusing that the 'Features dir' is described as "Directory, relative to workspace, to search for cucumber .json test results. Default value is job workspace." - Why are features and json test results mixed in one directory? Usually features are in workspace/src/features, and the json gets generated inside a build or target dir.

I'm running on a master-only Jenkins, version 2.7.1, with the latest version of the Living Doc plugin.

tfnico commented 8 years ago

Turns out the underlying problem is that cukedoctor cannot handle my json file:

Jul 29, 2016 10:47:22 AM com.github.cukedoctor.parser.FeatureParser parse
WARNING: Could not map json file:/usr/share/tomcat7/.jenkins/jobs/webtest-testing/builds/12/build/cucumber-results/cucumber.json
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "comments" (class com.github.cukedoctor.api.model.Row), not marked as ignorable (one known property: "cells"])
 at [Source: java.io.InputStreamReader@3f3365ce; line: 765, column: 30] (through reference chain: java.util.ArrayList[4]->com.github.cukedoctor.api.model.Feature["elements"]->java.util.ArrayList[0]->com.github.cukedoctor.api.model.Scenario["steps"]->java.util.ArrayList[1]->com.github.cukedoctor.api.model.Step["rows"]->Object[][0]->com.github.cukedoctor.api.model.Row["comments"])
        at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
        at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:855)
        at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1083)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1389)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1367)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:266)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
        at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:196)
        at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:20)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:260)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:260)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:260)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3789)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2833)
        at com.github.cukedoctor.parser.FeatureParser.parse(FeatureParser.java:31)
        at com.github.cukedoctor.parser.FeatureParser.parse(FeatureParser.java:68)
        at com.github.cukedoctor.parser.FeatureParser.findAndParse(FeatureParser.java:101)
        at com.github.cukedoctor.jenkins.CukedoctorPublisher.perform(CukedoctorPublisher.java:142)
        at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
        at hudson.model.Build$BuildExecution.post2(Build.java:185)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
        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:410)

I'm reporting the issue in their repo as well. A reference should appear below shortly.

rmpestano commented 8 years ago

Hi @tfnico,

can you test with this snapshot: http://maven.jenkins-ci.org:8081/content/repositories/snapshots/org/jenkins-ci/plugins/cucumber-living-documentation/1.0.4-SNAPSHOT/cucumber-living-documentation-1.0.4-20160729.160957-1.hpi ?

tfnico commented 8 years ago

@rmpestano That works. Thanks a lot!

rmpestano commented 8 years ago

I will push a release soon.