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

Allure gradle plugin causes execution of additonal test sets as part of build task #75

Closed
1 of 3 tasks
benjamindibonasonos opened this issue Oct 6, 2021 · 3 comments · Fixed by #76
Closed
1 of 3 tasks

Comments

@benjamindibonasonos
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

After upgrading Allure gradle plugin from 2.8.1 to 2.9.4, the gradle build task now includes compilation and execution of test sets other than unit tests.

We use the gradle test sets plugin to manage our integration tests, which states

By default, the tests in a custom test set are not executed when you call gradle build.

https://github.com/unbroken-dome/gradle-testsets-plugin

Reverting back to allure-gradle 2.8.1, the build task only executes the unit tests, which is the expected behavior.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Gradle build task should only execute unit tests.

Please tell us about your environment:

| allure-gradle version | 2.9.4 |
| Gradle version | 6.9 |
| Unbroken Dome Test-Sets version| 4.0.0 |
| Test framework | JUnit 5 |

Other information

We have included a testSets configuration in build.gradle like the following:
testSets { functionalTests {} }

@NielsDoucet
Copy link

We have noticed the same behaviour, where tests are being run when requesting the assemble task.
After discussing with @vlsi on the gradle community slack, it appears this is related to gradle/gradle#6875, as allure results are attached to the build as an artifact.

@benjamindibonasonos Could you verify that you also see those tests executed if you run ./gradlew assemble?

@vlsi
Copy link
Contributor

vlsi commented Oct 7, 2021

If you need to configure allure for certain tasks only, I would suggest the following:

allure {
    adapter {
        // Disable automatic configuration
        autoconfigure.set(false)

        // Gather report data from test task only
        gatherResultsFrom(tasks.test)
        addAspectjTo(tasks.test)
    }
}

However, it might be worth adding a slightly better DSL instead of gatherResultsFrom and addAspectjTo .

@benjamindibonasonos
Copy link
Author

benjamindibonasonos commented Oct 7, 2021

We have noticed the same behaviour, where tests are being run when requesting the assemble task. After discussing with @vlsi on the gradle community slack, it appears this is related to gradle/gradle#6875, as allure results are attached to the build as an artifact.

@benjamindibonasonos Could you verify that you also see those tests executed if you run ./gradlew assemble?

@NielsDoucet I can confirm that these tests are executed with the "assemble" task.

./gradlew assemble --console=plain                                                                                              
> Task :bootBuildInfo
> Task :compileJava UP-TO-DATE
> Task :processResources
> Task :classes
> Task :bootJarMainClassName
> Task :bootJar
> Task :compileFunctionalTestJava
> Task :processFunctionalTestResources UP-TO-DATE
> Task :functionalTestClasses
> Task :functionalTest

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

Successfully merging a pull request may close this issue.

3 participants