cucumber-attic / gherkin2

A fast Gherkin parser in Ragel (The parser behind Cucumber)
MIT License
382 stars 221 forks source link

Cucumber generating empty JSON file upon multiple feature failures. #340

Closed kapoorlakshya closed 8 years ago

kapoorlakshya commented 8 years ago

I am using Cucumber 1.3.17 with ruby 1.9.3p545. We have nightly tests configured to run Cucumber features via Jenkins on two Windows 7 slave nodes. We use the Jenkins Cucumber plugin to generate pretty reports. The issue is that the plugin is frequently finding empty JSON files. This is the message in the console:

C:\Jenkins\workspace\UI_Automation\trunk\Automation\ui>exit 0 
POST BUILD TASK : SUCCESS
END OF POST BUILD TASK : 0
[CucumberReportPublisher] Compiling Cucumber Html Reports ...
[CucumberReportPublisher] Copying all json files from slave: C:\Jenkins\workspace\UI_Automation\results to master reports directory: C:\Jenkins\jobs\UI_Automation\builds\796\cucumber-html-reports
[CucumberReportPublisher] Found 1 json files.
[CucumberReportPublisher] 0. Found a json file: cucumber.json
[CucumberReportPublisher] Generating HTML reports
[Cucumber Tests] Parsing results.
[Cucumber Tests] ignoring empty file (cucumber.json)
No cucumber scenarios appear to have been run.
Build step 'Publish Cucumber test result report' changed build result to FAILURE

While troubleshooting, I noticed that our test started executing at 12:04 AM and ran for about 9 hours overnight. However, the cucumber.json was last modified at 12:05 AM which means the results were never written to it. I am unable to figure out what could possibly be preventing Cucumber from writing to the JSON file. When I run the cucumber feature manually on the slave, the JSON is generated. It even generates a file when I run a single feature file by itself.

Please help me troubleshoot this.

mattwynne commented 8 years ago

The right place to get help with this kind of issue is here: https://groups.google.com/forum/#!forum/cukes

I suggest you try changing your configuration to run just one scenario on the slave, and run it through Jenkins to see if that can help you debug it. This really doesn't sound like a bug in Cucumber, more an issue to do with your build setup, which sounds pretty complex to me. That said, you're also using an out of date version of Cucumber, so I'd like you to try upgrading before raising any more tickets please.