trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.
https://www.softwaretester.blog
Apache License 2.0
271 stars 88 forks source link

No generated-report folder from v 2.9 in a "submodule" world #301

Closed OxygeneIV closed 1 year ago

OxygeneIV commented 1 year ago

Thanks for the last Assume-fix! I had to switch to v3 (from 2.7) to get it I understand, but I see a change in how the submodules are handled. In 2.7 it seems to work but from 2.9 the submodules are skipped, i.e. no generated-report folder is created for them, only at the POM-module atg-horse-test-automation (but its empty of course, no results) Earlier versions worked through all modules. Any idea? I'll try to add the folder name somehow, hardcoded.

2.9.0 =>

[INFO] Reactor Summary for atg-horse-test-automation 0.0.1-SNAPSHOT:
[INFO]
[INFO] atg-horse-test-automation .......................... SUCCESS [  0.501 s]
[INFO] common-service ..................................... SKIPPED
[INFO] horse-frontend ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
OxygeneIV commented 1 year ago

-pl horse-frontend on the command line seems to do the job, at least locally. I think we'll be fine with that, but interesting. Sorry bothering You twice today.

bischoffdev commented 1 year ago

Oh interesting, will investigate tomorrow.

bischoffdev commented 1 year ago

I am not sure I am following what you mean. For this, a minimal example project would help a lot. Also, some more explanation about what the sub modules are doing would be nice.

As far as I understand you have a multi-module Maven project.

lunmag commented 1 year ago

Hi!

Yes, a multi-module Maven project

<name>atg-horse-test-automation</name>
<description>Sample</description>
<packaging>pom</packaging>

<modules>
  <module>common-service</module>
  <module>horse-frontend</module>
</modules>

After running tests we get a cucumber-report folder in horse-frontend/target including a cucumber.json - file. This is the only place we get a cucumber.json file

The source JSON/generated HTML variables point to folder ${project.build.directory} This can of course be changed, but we might have tests in several submodules I guess. All commands are executed from project root folder.

mvnw.cmd cluecumber:reporting

09:59:25.701 INFO: ------------------------------------------------------------------------
09:59:25.704 INFO:  [ Cluecumber v3.0.1 ]
09:59:25.704 INFO: ------------------------------------------------------------------------
09:59:25.706 INFO: - source JSON report directory     : C:\repos\horse-test-automation\target/cucumber-report
09:59:25.707 INFO: - generated HTML report directory  : C:\repos\horse-test-automation\target/generated-report
09:59:25.709 INFO: ------------------------------------------------------------------------
09:59:25.712 INFO: - fail pending/undefined scenarios : false
09:59:25.713 INFO: - expand before/after hooks        : true
09:59:25.714 INFO: - expand step hooks                : false
09:59:25.715 INFO: - expand doc strings               : false
09:59:25.716 INFO: - expand attachments               : false
09:59:25.716 INFO: - page title                       : Cluecumber Report
09:59:25.717 INFO: - start page                       : ALL_SCENARIOS
09:59:25.718 INFO: - custom parameters display mode   : SCENARIO_PAGES
09:59:25.726 INFO: - colors (passed, failed, skipped) : #60cc79, #fc7180, #f7c42b
09:59:25.728 INFO: ------------------------------------------------------------------------
09:59:25.731 WARN: Unable to traverse JSON files in C:\repos\horse-test-automation\target/cucumber-report
09:59:25.960 INFO: => Cluecumber Report: C:\repos\horse-test-automation\target/generated-report/index.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for atg-horse-test-automation 0.0.1-SNAPSHOT:
[INFO]
[INFO] atg-horse-test-automation .......................... SUCCESS [  0.518 s]
[INFO] common-service ..................................... SKIPPED
[INFO] horse-frontend ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.840 s
[INFO] Finished at: 2022-12-19T09:59:25+01:00
[INFO] ------------------------------------------------------------------------

We get an empty report in the root module, no reports in the submodules Empty report: horse-test-automation\target\generated-report

Adding -pl to the reporting mvnw.cmd cluecumber:reporting -pl horse-frontend generates a report with details.

10:05:13.047 INFO:  [ Cluecumber v3.0.1 ]
10:05:13.048 INFO: ------------------------------------------------------------------------
10:05:13.049 INFO: - source JSON report directory     : C:\repos\horse-test-automation\horse-frontend\target/cucumber-report
10:05:13.050 INFO: - generated HTML report directory  : C:\repos\horse-test-automation\horse-frontend\target/generated-report
10:05:13.052 INFO: ------------------------------------------------------------------------
10:05:13.055 INFO: - fail pending/undefined scenarios : false
10:05:13.056 INFO: - expand before/after hooks        : true
10:05:13.057 INFO: - expand step hooks                : false
10:05:13.058 INFO: - expand doc strings               : false
10:05:13.059 INFO: - expand attachments               : false
10:05:13.059 INFO: - page title                       : Cluecumber Report
10:05:13.060 INFO: - start page                       : ALL_SCENARIOS
10:05:13.061 INFO: - custom parameters display mode   : SCENARIO_PAGES
10:05:13.068 INFO: - colors (passed, failed, skipped) : #60cc79, #fc7180, #f7c42b
10:05:13.069 INFO: ------------------------------------------------------------------------
10:05:13.529 INFO: => Cluecumber Report: C:\repos\horse-test-automation\horse-frontend\target/generated-report/index.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.923 s
[INFO] Finished at: 2022-12-19T10:05:13+01:00
[INFO] ------------------------------------------------------------------------
bischoffdev commented 1 year ago

Hi, this seems to be a problem in your project setup. The way you run it will run the parent and the reporting directly. So at that point, there is no JSON available.

bischoffdev commented 1 year ago

I don't think there is anything that needs to be done within Cluecumber. If you disagree, please let me know and I will reopen this issue.

lunmag commented 1 year ago

Perfectly fine, thanks!