Skip to content

Commit bd6fe09

Browse files
committed
feat: configure allure-testng-7 module and fix compatibility issues
1 parent de50184 commit bd6fe09

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

allure-testng-7/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
description = "Allure TestNG Integration"
1+
description = "Allure TestNG 7 Integration"
22

3-
val testNgVersion = "6.14.3"
3+
val testNgVersion = "7.10.2"
44

55
dependencies {
66
api(project(":allure-java-commons"))
@@ -19,7 +19,7 @@ dependencies {
1919
tasks.jar {
2020
manifest {
2121
attributes(mapOf(
22-
"Automatic-Module-Name" to "io.qameta.allure.testng"
22+
"Automatic-Module-Name" to "io.qameta.allure.testng7"
2323
))
2424
}
2525
from("src/main/services") {

allure-testng-7/src/main/java/io/qameta/allure/testng/AllureTestNg.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ public void onTestFailedButWithinSuccessPercentage(final ITestResult result) {
469469
public void beforeInvocation(final IInvokedMethod method, final ITestResult testResult) {
470470
final ITestNGMethod testMethod = method.getTestMethod();
471471
final ITestContext context = testResult.getTestContext();
472-
if (isSupportedConfigurationFixture(testMethod)) {
472+
if (isSupportedConfigurationFixture(testMethod) && testResult.getStatus() != ITestResult.SKIP) {
473+
testResult.setAttribute("ALLURE_FIXTURE_STARTED", true);
473474
ifSuiteFixtureStarted(context.getSuite(), testMethod);
474475
ifTestFixtureStarted(context, testMethod);
475476
ifClassFixtureStarted(testMethod);
@@ -569,7 +570,8 @@ private FixtureResult getFixtureResult(final ITestNGMethod method) {
569570
@Override
570571
public void afterInvocation(final IInvokedMethod method, final ITestResult testResult) {
571572
final ITestNGMethod testMethod = method.getTestMethod();
572-
if (isSupportedConfigurationFixture(testMethod)) {
573+
if (isSupportedConfigurationFixture(testMethod) && testResult.getAttribute("ALLURE_FIXTURE_STARTED") != null) {
574+
testResult.removeAttribute("ALLURE_FIXTURE_STARTED");
573575
final String executableUuid = currentExecutable.get();
574576
currentExecutable.remove();
575577
if (testResult.isSuccess()) {

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ include("allure-spock2")
4040
include("allure-spring-web")
4141
include("allure-test-filter")
4242
include("allure-testng")
43+
include("allure-testng-7")
4344

4445
pluginManagement {
4546
repositories {

0 commit comments

Comments
 (0)