Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregated report from gradle submodules contains features from one module only #25

Open
arturobhn opened this issue May 7, 2020 · 3 comments

Comments

@arturobhn
Copy link

arturobhn commented May 7, 2020

While sending test reports generated by gradle submodules to a single folder in the root, and then running aggregate on that folder, generates a report with missing information like:
Overall Test Results Tab -- OK contains all the tests scenarios
Requirements Tab -- NOT OK contains information of a single scenario, meaning info from one gradle submodule only, rather than containing info from all gradle submodules.
I'm using these versions as per the started:

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:2.0.70")
        
    }
}

configurations.all {
    resolutionStrategy {
        force "io.cucumber:cucumber-core:4.2.0"
    }
}

dependencies {
    testCompile "net.serenity-bdd:serenity-core:2.0.70",
                "net.serenity-bdd:serenity-cucumber4:1.0.21",
                "io.cucumber:cucumber-core:4.2.0",
                "io.cucumber:cucumber-junit:4.2.0"
}

We can see here 2 scenarios reported:
Screen Shot 2020-05-06 at 10 17 28 PM

And here we can see a single one listed in Requirements Tab:
Screen Shot 2020-05-06 at 10 17 44 PM

Please let me know if you need further details.
Regards!

@wakaleo
Copy link
Member

wakaleo commented May 7, 2020

Could you try with the latest version and Cucumber 5?

@arturobhn
Copy link
Author

arturobhn commented May 7, 2020

Hello @wakaleo, I have updated the versions as advised, they now look like this:

defaultTasks 'clean','test','aggregate'
repositories {
    mavenLocal()
    jcenter()
}

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:2.2.0")
    }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
    compile "ch.qos.logback:logback-classic:1.2.3"
    testCompile "net.serenity-bdd:serenity-core:2.2.0",
                "net.serenity-bdd:serenity-cucumber5:2.2.0",
                "junit:junit:4.12"
}
test.finalizedBy(aggregate)

After that, it did not work either so I simplified the scenario and now I tried to generate a report for a single submodule on its default reporting folder, however, although the test passed and the report is generated; somehow Requirements Tab is still empty.
Is there any special consideration for it to display the features? I have compared the started project and they look all the same. See following screenshots:

Here we can see the report was generated and it contains a feature and an scenario:

Screen Shot 2020-05-07 at 8 07 29 AM

And then, here we can see Requirements Tab is no listing the feature:

Screen Shot 2020-05-07 at 8 07 45 AM

One importante thing to note is, I'm triggering this gradle task from the root project, if I run it directly from inside the submodule, the report is generated correctly.

The point is, what would happen if someone needs to run it from the root so all modules send their outputs to the root and then root can execute :aggregate.

Please let me know if any further details are required.
Regards

@arturobhn
Copy link
Author

I would add one more comment, the scenario we are trying to cover when we found out this issue is:

  • I have a root project with several submodules in gradle.
  • I want every submodule to generate its report in a given folder at the root project; i.e. /reports
  • Finally, I want the root project to run :aggregate to create a single report containing all reports from all submodules.
  • What I got is, a single report with all features in the Overall view, but I get an inconsistent content in the Requirements tab, sometimes I get no features, some other times I get features from a single submodule and so on.
  • I have tried 2 approaches:
    a) Executing each submodule and sending the output to a reports folder in the root project. Finally doing aggregate on the reports folder at root.
    b) Creating a runner at the root project and then executing each submodule simulating we have a single project (root) and assuming submodules are just folders inside my project.
  • In both cases, I get the single report but as I said, Requirements tab is the one not showing consistently.
  • In both cases, I run gradle tasks being at root folder.

I hope this provides more clarity about the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants