-
Notifications
You must be signed in to change notification settings - Fork 227
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
🐞: Project with Spock2 works with Maven but not with Gradle #933
Comments
Gradle plugin replaces dependencies for module allure-spock2 with allure-spock. |
Do I understand you correctly, that the Gradle plugin is missing Spock2 support ATM? |
It seems so. If you specify Tried to replace dependecy with gradle modules https://docs.gradle.org/current/userguide/resolution_rules.html#sec:module_replacement to force use of correct library and the error is gone. But steps (blocks: 'when', 'then' etc) is not picked up by allure anymore. |
Is it possible to setup allure with spock2 without gradle plugin until support is added? With just dependency added allure is not able to detect spock blocks as steps correctly. |
You can manually configure the required dependencies instead of relying on Gradle auto-config. allure {
adapter {
// AspectJ Weaver is fine, but make sure the latest available version is used
aspectjWeaver.set(true)
aspectjVersion.set("1.9.19")
// in order to disable dependencySubstitution (spi-off classifier)
autoconfigureListeners.set(true)
// disable auto-configuring dependencies
autoconfigure.set(false)
afterEvaluate {
frameworks.forEach { adapter -> adapter.enabled.set(false) }
}
}
} After that, you need to define the required dependencies manually: testImplementation("io.qameta.allure:allure-spock2:2.23.0") Make sure |
@re-l124c41 in my example project this would mean a change like: karltiirik/spock-restassured-allure@6d532fa. Tried it out, seems to be working. |
I experimented with configuration, and it seems that blocks with comments and 'then' blocks are not reported. |
fixed in #951 |
working example can be found here https://github.com/allure-examples/allure-spock2-gradle-kts |
What happened?
.\gradlew clean test
Expected: tests pass
Actual: tests fail with:
Tests work with the Maven build system:
./mvnw clean test
The error message is similar to #466 issue (aka prior to adding spock2 support). Is this support missing from the Gradle plugin?
What Allure Integration are you using?
allure-spock2, allure-rest-assured
What version of Allure Integration you are using?
2.23.0
What version of Allure Report you are using?
2.23.0
Code of Conduct
The text was updated successfully, but these errors were encountered: