From 88552d292aafde7370638098776a0b2a7c578d92 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 11 Apr 2024 12:55:03 +0300 Subject: [PATCH 1/6] Action version update --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1da2fd9..04fc1a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: java-version: '8' - name: Setup git credentials - uses: oleksiyrudenko/gha-git-credentials@v2.1.1 + uses: oleksiyrudenko/gha-git-credentials@v2-latest with: name: 'reportportal.io' email: 'support@reportportal.io' From 712e4d471e0a9e5f9502d1baf6ab1760240c0f89 Mon Sep 17 00:00:00 2001 From: Yevhen Piskun Date: Sat, 13 Apr 2024 14:12:06 +0300 Subject: [PATCH 2/6] RPP_Agents_Java_Spock_LastErrorLog - Task is to add a new feature to RP agent for Spock. Feature - add last error log to step description. --- .../spock/ReportPortalSpockListener.java | 17 ++++ ...iedErrorMessageWithoutDescriptionTest.java | 80 +++++++++++++++++++ ...eptionErrorMessageWithDescriptionTest.java | 69 ++++++++++++++++ ...ithoutErrorMessageWithDescriptionTest.java | 70 ++++++++++++++++ .../FailWithExceptionWithoutMessage.groovy | 17 ++++ 5 files changed, 253 insertions(+) create mode 100644 src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java create mode 100644 src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java create mode 100644 src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java create mode 100644 src/test/groovy/com/epam/reportportal/spock/features/fail/FailWithExceptionWithoutMessage.groovy diff --git a/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java b/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java index 5e707e9..c3979c1 100644 --- a/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java +++ b/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java @@ -31,6 +31,7 @@ import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; import com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ; import io.reactivex.Maybe; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.codehaus.groovy.runtime.StackTraceUtils; import org.slf4j.Logger; @@ -44,6 +45,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -74,6 +76,7 @@ public class ReportPortalSpockListener extends AbstractRunListener { .orElseThrow(() -> new IllegalStateException("Unknown Spock version."))); private final MemoizingSupplier launch; + private final Map, Pair> errorDescriptionMap = new ConcurrentHashMap<>(); // stores the bindings of Spock method kinds to the RP-specific notation private static final Map ITEM_TYPES_REGISTRY = Collections.unmodifiableMap(new HashMap() {{ @@ -274,6 +277,7 @@ protected Maybe startIteration(@Nonnull Maybe parentId, @Nonnull protected void reportIterationStart(@Nonnull Maybe parentId, @Nonnull StartTestItemRQ rq, @Nonnull IterationInfo iteration) { Maybe testItemId = startIteration(parentId, rq); launchContext.addRunningIteration(testItemId, iteration); + errorDescriptionMap.put(launchContext.findIterationFootprint(iteration).getId(), Pair.of(rq.getDescription(), StringUtils.EMPTY)); } public void registerIteration(@Nonnull IterationInfo iteration) { @@ -303,6 +307,15 @@ protected FinishTestItemRQ buildFinishTestItemRq(@Nonnull Maybe itemId, FinishTestItemRQ rq = new FinishTestItemRQ(); ofNullable(status).ifPresent(s -> rq.setStatus(s.name())); rq.setEndTime(Calendar.getInstance().getTime()); + if (Objects.equals(status, ItemStatus.FAILED) && errorDescriptionMap.containsKey(itemId)) { + if (Objects.nonNull(errorDescriptionMap.get(itemId).getLeft())) { + rq.setDescription( + String.format("%s\nError:\n%s", errorDescriptionMap.get(itemId).getLeft(), errorDescriptionMap.get(itemId).getRight())); + } else { + rq.setDescription(String.format("Error:\n%s", errorDescriptionMap.get(itemId).getRight())); + } + } + errorDescriptionMap.remove(itemId); return rq; } @@ -439,6 +452,10 @@ public void reportError(@Nonnull ErrorInfo error) { ofNullable(launchContext.findFeatureFootprint(method.getFeature())).ifPresent(f -> f.setStatus(FAILED)); ofNullable(launchContext.getRuntimePointerForSpec(method.getParent()) .getCurrentIteration()).map(launchContext::findIterationFootprint).ifPresent(i -> i.setStatus(FAILED)); + Maybe itemId = launchContext.findIterationFootprint(error.getMethod().getIteration()).getId(); + String startDescriptions = errorDescriptionMap.get(itemId).getLeft(); + Pair startFinishDescriptions = Pair.of(startDescriptions, error.getException().toString()); + errorDescriptionMap.put(itemId, startFinishDescriptions); logError(error); } else if (ITERATION_EXECUTION == kind) { ofNullable(launchContext.findIterationFootprint(method.getIteration())).ifPresent(i -> i.setStatus(FAILED)); diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java new file mode 100644 index 0000000..392e37a --- /dev/null +++ b/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java @@ -0,0 +1,80 @@ +package com.epam.reportportal.spock.description; + +import com.epam.reportportal.listeners.ItemStatus; +import com.epam.reportportal.service.ReportPortal; +import com.epam.reportportal.service.ReportPortalClient; +import com.epam.reportportal.spock.ReportPortalSpockListener; +import com.epam.reportportal.spock.features.fail.HelloSpockSpecFailed; +import com.epam.reportportal.spock.utils.TestExtension; +import com.epam.reportportal.spock.utils.TestUtils; +import com.epam.reportportal.util.test.CommonUtils; +import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.platform.launcher.listeners.TestExecutionSummary; +import org.mockito.ArgumentCaptor; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static com.epam.reportportal.spock.utils.TestUtils.runClasses; +import static com.epam.reportportal.spock.utils.TestUtils.standardParameters; +import static com.epam.reportportal.spock.utils.TestUtils.testExecutor; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class ConditionNotSatisfiedErrorMessageWithoutDescriptionTest { + + private final String classId = CommonUtils.namedId("class_"); + private final String methodId = CommonUtils.namedId("method_"); + private final List nestedSteps = Stream.generate(() -> CommonUtils.namedId("method_")).limit(3).collect(Collectors.toList()); + private final List> nestedStepsLink = nestedSteps.stream().map(s -> Pair.of(methodId, s)).collect(Collectors.toList()); + + private final ReportPortalClient client = mock(ReportPortalClient.class); + + private static final String ERROR_DESCRIPTION = "Error:\nCondition not satisfied:\n\nname.size() == length\n| | | |\n| 6 | 7\nScotty false\n"; + + + @BeforeEach + public void setupMock() { + TestUtils.mockLaunch(client, null, classId, methodId); + TestUtils.mockNestedSteps(client, nestedStepsLink); + TestUtils.mockBatchLogging(client); + TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); + } + + @Test + public void verify_error_condition_not_satisfied_message_without_description() { + + TestExecutionSummary result = runClasses(HelloSpockSpecFailed.class); + + assertThat(result.getTotalFailureCount(), equalTo(1L)); + + ArgumentCaptor finishNestedStepCaptor = ArgumentCaptor.forClass(FinishTestItemRQ.class); + nestedSteps.forEach(s -> verify(client).finishTestItem(eq(s), finishNestedStepCaptor.capture())); + + List passedFinishItemStatuses = finishNestedStepCaptor.getAllValues().stream() + .filter(finishTestItemRQ -> finishTestItemRQ.getStatus().equals(ItemStatus.PASSED.name())) + .collect(Collectors.toList()); + + assertThat(passedFinishItemStatuses, hasSize(2)); + + passedFinishItemStatuses.forEach(finishTestItemRQ -> assertThat(finishTestItemRQ.getDescription(), is(nullValue()))); + + List failedFinishItemStatuses = finishNestedStepCaptor.getAllValues().stream() + .filter(finishTestItemRQ -> finishTestItemRQ.getStatus().equals(ItemStatus.FAILED.name())) + .collect(Collectors.toList()); + + assertThat(failedFinishItemStatuses, hasSize(1)); + + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION)); + } +} \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java new file mode 100644 index 0000000..a3e9003 --- /dev/null +++ b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java @@ -0,0 +1,69 @@ +package com.epam.reportportal.spock.description; + +import com.epam.reportportal.listeners.ItemStatus; +import com.epam.reportportal.service.ReportPortal; +import com.epam.reportportal.service.ReportPortalClient; +import com.epam.reportportal.spock.ReportPortalSpockListener; +import com.epam.reportportal.spock.features.fail.FailsInDifferentMethod; +import com.epam.reportportal.spock.utils.TestExtension; +import com.epam.reportportal.spock.utils.TestUtils; +import com.epam.reportportal.util.test.CommonUtils; +import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.platform.launcher.listeners.TestExecutionSummary; +import org.mockito.ArgumentCaptor; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static com.epam.reportportal.spock.utils.TestUtils.runClasses; +import static com.epam.reportportal.spock.utils.TestUtils.standardParameters; +import static com.epam.reportportal.spock.utils.TestUtils.testExecutor; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class ExceptionErrorMessageWithDescriptionTest { + + private final String launchId = CommonUtils.namedId("launch_"); + private final String classId = CommonUtils.namedId("class_"); + private final List methodIds = Stream.generate(() -> CommonUtils.namedId("method_")).limit(1).collect(Collectors.toList()); + + private final ReportPortalClient client = mock(ReportPortalClient.class); + + private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \nError:\njava.lang.IllegalStateException: Some test flow failure"; + + @BeforeEach + public void setupMock() { + TestUtils.mockLaunch(client, launchId, classId, methodIds); + TestUtils.mockBatchLogging(client); + TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); + } + + @Test + public void verify_error_exception_message_with_description() { + + TestUtils.mockLaunch(client, launchId, classId, methodIds); + TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); + + TestExecutionSummary result = runClasses(FailsInDifferentMethod.class); + + assertThat(result.getTotalFailureCount(), equalTo(1L)); + + ArgumentCaptor finishStepCaptor = ArgumentCaptor.forClass(FinishTestItemRQ.class); + + methodIds.forEach(s -> verify(client).finishTestItem(eq(s), finishStepCaptor.capture())); + + List failedFinishItemStatuses = finishStepCaptor.getAllValues().stream() + .filter(fis -> fis.getStatus().equals(ItemStatus.FAILED.name())) + .collect(Collectors.toList()); + + assertThat(failedFinishItemStatuses, hasSize(1)); + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION_EXCEPTION)); + } +} \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java new file mode 100644 index 0000000..445a7d2 --- /dev/null +++ b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java @@ -0,0 +1,70 @@ +package com.epam.reportportal.spock.description; + +import com.epam.reportportal.listeners.ItemStatus; +import com.epam.reportportal.service.ReportPortal; +import com.epam.reportportal.service.ReportPortalClient; +import com.epam.reportportal.spock.ReportPortalSpockListener; +import com.epam.reportportal.spock.features.fail.FailWithExceptionWithoutMessage; +import com.epam.reportportal.spock.utils.TestExtension; +import com.epam.reportportal.spock.utils.TestUtils; +import com.epam.reportportal.util.test.CommonUtils; +import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.platform.launcher.listeners.TestExecutionSummary; +import org.mockito.ArgumentCaptor; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static com.epam.reportportal.spock.utils.TestUtils.runClasses; +import static com.epam.reportportal.spock.utils.TestUtils.standardParameters; +import static com.epam.reportportal.spock.utils.TestUtils.testExecutor; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class ExceptionWithoutErrorMessageWithDescriptionTest { + + private final String launchId = CommonUtils.namedId("launch_"); + private final String classId = CommonUtils.namedId("class_"); + private final List methodIds = Stream.generate(() -> CommonUtils.namedId("method_")).limit(1).collect(Collectors.toList()); + + private final ReportPortalClient client = mock(ReportPortalClient.class); + + private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \nWhen: \nThen: \nError:\njava.util.NoSuchElementException"; + + @BeforeEach + public void setupMock() { + TestUtils.mockLaunch(client, launchId, classId, methodIds); + TestUtils.mockBatchLogging(client); + TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); + } + + @Test + public void verify_exception_without_error_message_with_description() { + + TestUtils.mockLaunch(client, launchId, classId, methodIds); + TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); + + TestExecutionSummary result = runClasses(FailWithExceptionWithoutMessage.class); + + assertThat(result.getTotalFailureCount(), equalTo(1L)); + + ArgumentCaptor finishStepCaptor = ArgumentCaptor.forClass(FinishTestItemRQ.class); + + methodIds.forEach(s -> verify(client).finishTestItem(eq(s), finishStepCaptor.capture())); + + List failedFinishItemStatuses = finishStepCaptor.getAllValues() + .stream() + .filter(fis -> fis.getStatus().equals(ItemStatus.FAILED.name())) + .collect(Collectors.toList()); + + assertThat(failedFinishItemStatuses, hasSize(1)); + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION_EXCEPTION)); + } +} \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/features/fail/FailWithExceptionWithoutMessage.groovy b/src/test/groovy/com/epam/reportportal/spock/features/fail/FailWithExceptionWithoutMessage.groovy new file mode 100644 index 0000000..ab87c9c --- /dev/null +++ b/src/test/groovy/com/epam/reportportal/spock/features/fail/FailWithExceptionWithoutMessage.groovy @@ -0,0 +1,17 @@ +package com.epam.reportportal.spock.features.fail + +import spock.lang.Specification + +class FailWithExceptionWithoutMessage extends Specification { + + def "should demonstrate NoSuchElementException given-when-then fail"() { + given: + def polygon = new ArrayList() + + when: + polygon.size() + + then: + throw new NoSuchElementException() + } +} \ No newline at end of file From 434efd0883b76162755f4057992a975857f01c27 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 16:53:23 +0300 Subject: [PATCH 3/6] Client version update --- CHANGELOG.md | 2 ++ build.gradle | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef19080..08e77cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Changed +- Client version updated on [5.2.25](https://github.com/reportportal/client-java/releases/tag/5.2.25), by @HardNorth ## [5.2.3] ### Changed diff --git a/build.gradle b/build.gradle index be71c19..f68d5dc 100644 --- a/build.gradle +++ b/build.gradle @@ -39,22 +39,22 @@ repositories { } dependencies { - api "com.epam.reportportal:client-java:5.2.13" + api "com.epam.reportportal:client-java:5.2.25" compileOnly "org.spockframework:spock-core:${spock_version}" implementation 'org.slf4j:slf4j-api:2.0.7' testImplementation "org.spockframework:spock-core:${spock_version}" testImplementation 'org.codehaus.groovy:groovy:2.5.14' - testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.6' + testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.7' testImplementation 'org.aspectj:aspectjweaver:1.9.19' testImplementation 'org.hamcrest:hamcrest-core:2.2' testImplementation "org.mockito:mockito-core:${mockito_version}" testImplementation "org.mockito:mockito-inline:${mockito_version}" testImplementation "org.mockito:mockito-junit-jupiter:${mockito_version}" - testImplementation 'ch.qos.logback:logback-classic:1.3.12' - testImplementation 'com.epam.reportportal:logger-java-logback:5.2.2' + testImplementation 'ch.qos.logback:logback-classic:1.3.15' + testImplementation 'com.epam.reportportal:logger-java-logback:5.2.3' testImplementation ("org.junit.platform:junit-platform-runner:${junit5_launcher_version}") { exclude module: 'junit' } From cf8c453439ab324cb291d5ccc49196a1b1c1588e Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 17:03:06 +0300 Subject: [PATCH 4/6] Update last error logging --- CHANGELOG.md | 2 ++ .../spock/ReportPortalSpockListener.java | 35 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08e77cf..e9abace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Added +- Putting last error logs of tests to Items' description, by @YevhenPiskun ### Changed - Client version updated on [5.2.25](https://github.com/reportportal/client-java/releases/tag/5.2.25), by @HardNorth diff --git a/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java b/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java index c3979c1..8469db1 100644 --- a/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java +++ b/src/main/java/com/epam/reportportal/spock/ReportPortalSpockListener.java @@ -25,6 +25,8 @@ import com.epam.reportportal.service.item.TestCaseIdEntry; import com.epam.reportportal.spock.utils.SystemAttributesFetcher; import com.epam.reportportal.utils.*; +import com.epam.reportportal.utils.formatting.ExceptionUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.ta.reportportal.ws.model.FinishExecutionRQ; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; import com.epam.ta.reportportal.ws.model.StartTestItemRQ; @@ -141,7 +143,8 @@ public Maybe startLaunch() { launchContext.setLaunchId(launchId); return launchId; } catch (ReportPortalException ex) { - handleRpException(ex, + handleRpException( + ex, "Unable start the launch: '" + ofNullable(launchParameters).map(ListenerParameters::getLaunchName) .orElse("Unknown Launch") + "'" ); @@ -213,9 +216,11 @@ protected Maybe startFixture(@Nonnull Maybe parentId, @Nonnull S public void registerFixture(SpecInfo spec, @Nonnull FeatureInfo feature, IterationInfo iteration, @Nonnull MethodInfo fixture) { NodeFootprint specFootprint = launchContext.findSpecFootprint(spec); StartTestItemRQ rq = buildFixtureItemRq(feature, fixture, !fixture.getParent().equals(specFootprint.getItem())); - Maybe testItemId = startFixture(rq.isHasStats() ? - specFootprint.getId() : - launchContext.findFeatureFootprint(feature).getId(), rq); + Maybe testItemId = startFixture( + rq.isHasStats() ? + specFootprint.getId() : + launchContext.findFeatureFootprint(feature).getId(), rq + ); @SuppressWarnings("rawtypes") NodeFootprint fixtureOwnerFootprint = findFixtureOwner(spec, feature, iteration, fixture); fixtureOwnerFootprint.addFixtureFootprint(new FixtureFootprint(fixture, testItemId)); @@ -262,7 +267,8 @@ protected StartTestItemRQ buildIterationItemRq(@Nonnull IterationInfo iteration) .orElse(null)); List paramList = ofNullable(params).orElse(Collections.emptyList()); List names = iteration.getFeature().getParameterNames(); - rq.setParameters(ParameterUtils.getParameters(codeRef, + rq.setParameters(ParameterUtils.getParameters( + codeRef, IntStream.range(0, paramList.size()).mapToObj(i -> Pair.of(names.get(i), paramList.get(i))).collect(Collectors.toList()) )); setFeatureAttributes(rq, iteration.getFeature()); @@ -282,12 +288,14 @@ protected void reportIterationStart(@Nonnull Maybe parentId, @Nonnull St public void registerIteration(@Nonnull IterationInfo iteration) { if (iteration.getFeature().isReportIterations()) { - reportIterationStart(launchContext.findSpecFootprint(iteration.getFeature().getSpec()).getId(), + reportIterationStart( + launchContext.findSpecFootprint(iteration.getFeature().getSpec()).getId(), buildIterationItemRq(iteration), iteration ); } else if (iteration.getFeature().isParameterized()) { - reportIterationStart(launchContext.findFeatureFootprint(iteration.getFeature()).getId(), + reportIterationStart( + launchContext.findFeatureFootprint(iteration.getFeature()).getId(), buildNestedIterationItemRq(iteration), iteration ); @@ -308,11 +316,11 @@ protected FinishTestItemRQ buildFinishTestItemRq(@Nonnull Maybe itemId, ofNullable(status).ifPresent(s -> rq.setStatus(s.name())); rq.setEndTime(Calendar.getInstance().getTime()); if (Objects.equals(status, ItemStatus.FAILED) && errorDescriptionMap.containsKey(itemId)) { - if (Objects.nonNull(errorDescriptionMap.get(itemId).getLeft())) { - rq.setDescription( - String.format("%s\nError:\n%s", errorDescriptionMap.get(itemId).getLeft(), errorDescriptionMap.get(itemId).getRight())); + String formattedException = String.format("Error:\n%s", errorDescriptionMap.get(itemId).getRight()); + if (StringUtils.isNotBlank(errorDescriptionMap.get(itemId).getLeft())) { + rq.setDescription(MarkdownUtils.asTwoParts(errorDescriptionMap.get(itemId).getLeft(), formattedException)); } else { - rq.setDescription(String.format("Error:\n%s", errorDescriptionMap.get(itemId).getRight())); + rq.setDescription(String.format(formattedException)); } } errorDescriptionMap.remove(itemId); @@ -454,7 +462,10 @@ public void reportError(@Nonnull ErrorInfo error) { .getCurrentIteration()).map(launchContext::findIterationFootprint).ifPresent(i -> i.setStatus(FAILED)); Maybe itemId = launchContext.findIterationFootprint(error.getMethod().getIteration()).getId(); String startDescriptions = errorDescriptionMap.get(itemId).getLeft(); - Pair startFinishDescriptions = Pair.of(startDescriptions, error.getException().toString()); + Pair startFinishDescriptions = Pair.of( + startDescriptions, + ExceptionUtils.getStackTrace(error.getException(), new Throwable()) + ); errorDescriptionMap.put(itemId, startFinishDescriptions); logError(error); } else if (ITERATION_EXECUTION == kind) { From 5715c1a1425560702b44d27f9e96b29c310afb88 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 17:37:14 +0300 Subject: [PATCH 5/6] Fix tests --- .../ExceptionErrorMessageWithDescriptionTest.java | 11 +++-------- ...ceptionWithoutErrorMessageWithDescriptionTest.java | 11 +++-------- .../fixtures/TestCleanupFixtureFailureIntegrity.java | 1 + .../spock/fixtures/TestCleanupFixtureIntegrity.java | 1 + .../TestCleanupSpecFixtureFailureIntegrity.java | 1 + .../fixtures/TestCleanupSpecFixtureIntegrity.java | 1 + .../TestParametersSetupFixtureFailureIntegrity.java | 1 + .../fixtures/TestSetupFixtureFailureIntegrity.java | 1 + .../spock/fixtures/TestSetupFixtureIntegrity.java | 1 + .../TestSetupSpecFixtureFailureIntegrity.java | 1 + ...upSpecFixtureFailureParametersUnrollIntegrity.java | 1 + .../spock/fixtures/TestSetupSpecFixtureIntegrity.java | 1 + ...tUnrollParametersSetupFixtureFailureIntegrity.java | 1 + 13 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java index a3e9003..75e7f7d 100644 --- a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java +++ b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionErrorMessageWithDescriptionTest.java @@ -22,8 +22,7 @@ import static com.epam.reportportal.spock.utils.TestUtils.standardParameters; import static com.epam.reportportal.spock.utils.TestUtils.testExecutor; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -36,7 +35,7 @@ public class ExceptionErrorMessageWithDescriptionTest { private final ReportPortalClient client = mock(ReportPortalClient.class); - private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \nError:\njava.lang.IllegalStateException: Some test flow failure"; + private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \n\n---\n\nError:\njava.lang.IllegalStateException: Some test flow failure"; @BeforeEach public void setupMock() { @@ -47,10 +46,6 @@ public void setupMock() { @Test public void verify_error_exception_message_with_description() { - - TestUtils.mockLaunch(client, launchId, classId, methodIds); - TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); - TestExecutionSummary result = runClasses(FailsInDifferentMethod.class); assertThat(result.getTotalFailureCount(), equalTo(1L)); @@ -64,6 +59,6 @@ public void verify_error_exception_message_with_description() { .collect(Collectors.toList()); assertThat(failedFinishItemStatuses, hasSize(1)); - assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION_EXCEPTION)); + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), startsWith(ERROR_DESCRIPTION_EXCEPTION)); } } \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java index 445a7d2..db75236 100644 --- a/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java +++ b/src/test/groovy/com/epam/reportportal/spock/description/ExceptionWithoutErrorMessageWithDescriptionTest.java @@ -22,8 +22,7 @@ import static com.epam.reportportal.spock.utils.TestUtils.standardParameters; import static com.epam.reportportal.spock.utils.TestUtils.testExecutor; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -36,7 +35,7 @@ public class ExceptionWithoutErrorMessageWithDescriptionTest { private final ReportPortalClient client = mock(ReportPortalClient.class); - private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \nWhen: \nThen: \nError:\njava.util.NoSuchElementException"; + private static final String ERROR_DESCRIPTION_EXCEPTION = "Setup: \nWhen: \nThen: \n\n---\n\nError:\njava.util.NoSuchElementException"; @BeforeEach public void setupMock() { @@ -47,10 +46,6 @@ public void setupMock() { @Test public void verify_exception_without_error_message_with_description() { - - TestUtils.mockLaunch(client, launchId, classId, methodIds); - TestExtension.listener = new ReportPortalSpockListener(ReportPortal.create(client, standardParameters(), testExecutor())); - TestExecutionSummary result = runClasses(FailWithExceptionWithoutMessage.class); assertThat(result.getTotalFailureCount(), equalTo(1L)); @@ -65,6 +60,6 @@ public void verify_exception_without_error_message_with_description() { .collect(Collectors.toList()); assertThat(failedFinishItemStatuses, hasSize(1)); - assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION_EXCEPTION)); + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), startsWith(ERROR_DESCRIPTION_EXCEPTION)); } } \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureFailureIntegrity.java index 17cc39e..ae4fe0a 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureFailureIntegrity.java @@ -63,6 +63,7 @@ public void verify_setup_fixture_failure_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureIntegrity.java index f102fa7..101ac23 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupFixtureIntegrity.java @@ -63,6 +63,7 @@ public void verify_cleanup_fixture_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureFailureIntegrity.java index 00f6a9f..16f7b59 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureFailureIntegrity.java @@ -63,6 +63,7 @@ public void verify_setup_fixture_failure_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureIntegrity.java index d6357a3..2b1ed55 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestCleanupSpecFixtureIntegrity.java @@ -63,6 +63,7 @@ public void verify_spec_fixture_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestParametersSetupFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestParametersSetupFixtureFailureIntegrity.java index 7388d3e..7abad6f 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestParametersSetupFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestParametersSetupFixtureFailureIntegrity.java @@ -70,6 +70,7 @@ public void verify_setup_fixture_failure_correct_reporting_parameterized_feature assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); verify(client).startTestItem(same(classId), any(StartTestItemRQ.class)); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureFailureIntegrity.java index d834966..10af8fe 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureFailureIntegrity.java @@ -64,6 +64,7 @@ public void verify_setup_fixture_failure_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureIntegrity.java index 3becf5f..0365ab8 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupFixtureIntegrity.java @@ -63,6 +63,7 @@ public void verify_setup_fixture_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureIntegrity.java index 99688f2..3af85ed 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureIntegrity.java @@ -64,6 +64,7 @@ public void verify_setup_spec_failure_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startFeatureCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureParametersUnrollIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureParametersUnrollIntegrity.java index 1a0f415..f5bc2cb 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureParametersUnrollIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureFailureParametersUnrollIntegrity.java @@ -64,6 +64,7 @@ public void verify_setup_spec_failure_parameters_unroll_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startFeatureCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureIntegrity.java index 4418845..280044e 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestSetupSpecFixtureIntegrity.java @@ -63,6 +63,7 @@ public void verify_setup_spec_fixture_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestUnrollParametersSetupFixtureFailureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestUnrollParametersSetupFixtureFailureIntegrity.java index 548651d..8e7996b 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fixtures/TestUnrollParametersSetupFixtureFailureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/fixtures/TestUnrollParametersSetupFixtureFailureIntegrity.java @@ -70,6 +70,7 @@ public void verify_setup_fixture_failure_correct_reporting_unrolled_feature() { assertThat(result.getTotalFailureCount(), equalTo(3L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); From 2705d9093b9db8b4c1da4d07ff2e394af594950e Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 17:56:11 +0300 Subject: [PATCH 6/6] Fix tests --- ...ditionNotSatisfiedErrorMessageWithoutDescriptionTest.java | 5 +++-- .../spock/fail/TestFailsWithAnnotationFailed.java | 1 + .../reportportal/spock/fail/TestFailsWithStackTrace.java | 1 + .../reportportal/spock/fail/ThreeStepsOneFailedTest.java | 1 + .../spock/ignore/TestIgnoreFeatureIntegrity.java | 1 + .../spock/ignore/TestIgnoreOtherFeaturesIntegrity.java | 1 + .../spock/nestedsteps/TestNoNestedStepsWhenNoParameters.java | 1 + 7 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java b/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java index 392e37a..ded900c 100644 --- a/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java +++ b/src/test/groovy/com/epam/reportportal/spock/description/ConditionNotSatisfiedErrorMessageWithoutDescriptionTest.java @@ -27,6 +27,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; +import static org.hamcrest.Matchers.startsWith; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -40,7 +41,7 @@ public class ConditionNotSatisfiedErrorMessageWithoutDescriptionTest { private final ReportPortalClient client = mock(ReportPortalClient.class); - private static final String ERROR_DESCRIPTION = "Error:\nCondition not satisfied:\n\nname.size() == length\n| | | |\n| 6 | 7\nScotty false\n"; + private static final String ERROR_DESCRIPTION = "Error:\nCondition not satisfied:\nname.size() == length\n| | | |\n| 6 | 7\nScotty false\n"; @BeforeEach @@ -75,6 +76,6 @@ public void verify_error_condition_not_satisfied_message_without_description() { assertThat(failedFinishItemStatuses, hasSize(1)); - assertThat(failedFinishItemStatuses.iterator().next().getDescription(), equalTo(ERROR_DESCRIPTION)); + assertThat(failedFinishItemStatuses.iterator().next().getDescription(), startsWith(ERROR_DESCRIPTION)); } } \ No newline at end of file diff --git a/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithAnnotationFailed.java b/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithAnnotationFailed.java index 10f7533..1c9394c 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithAnnotationFailed.java +++ b/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithAnnotationFailed.java @@ -69,6 +69,7 @@ public void verify_fail_with_failed_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); verify(client).startTestItem(any(StartTestItemRQ.class)); diff --git a/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithStackTrace.java b/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithStackTrace.java index a214471..0aa2c27 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithStackTrace.java +++ b/src/test/groovy/com/epam/reportportal/spock/fail/TestFailsWithStackTrace.java @@ -69,6 +69,7 @@ public void verify_fail_with_failed_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); verify(client).startTestItem(any(StartTestItemRQ.class)); diff --git a/src/test/groovy/com/epam/reportportal/spock/fail/ThreeStepsOneFailedTest.java b/src/test/groovy/com/epam/reportportal/spock/fail/ThreeStepsOneFailedTest.java index 3d84a55..cb92d41 100644 --- a/src/test/groovy/com/epam/reportportal/spock/fail/ThreeStepsOneFailedTest.java +++ b/src/test/groovy/com/epam/reportportal/spock/fail/ThreeStepsOneFailedTest.java @@ -66,6 +66,7 @@ public void verify_one_failed_unrolled_step_reporting() { assertThat(result.getTotalFailureCount(), equalTo(1L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); verify(client).startTestItem(any(StartTestItemRQ.class)); diff --git a/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreFeatureIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreFeatureIntegrity.java index 5e6e669..4c856e9 100644 --- a/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreFeatureIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreFeatureIntegrity.java @@ -64,6 +64,7 @@ public void verify_ignored_feature_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreOtherFeaturesIntegrity.java b/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreOtherFeaturesIntegrity.java index d52fa9e..1085224 100644 --- a/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreOtherFeaturesIntegrity.java +++ b/src/test/groovy/com/epam/reportportal/spock/ignore/TestIgnoreOtherFeaturesIntegrity.java @@ -65,6 +65,7 @@ public void verify_ignored_feature_correct_reporting() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); ArgumentCaptor startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class); diff --git a/src/test/groovy/com/epam/reportportal/spock/nestedsteps/TestNoNestedStepsWhenNoParameters.java b/src/test/groovy/com/epam/reportportal/spock/nestedsteps/TestNoNestedStepsWhenNoParameters.java index be7f003..43428f3 100644 --- a/src/test/groovy/com/epam/reportportal/spock/nestedsteps/TestNoNestedStepsWhenNoParameters.java +++ b/src/test/groovy/com/epam/reportportal/spock/nestedsteps/TestNoNestedStepsWhenNoParameters.java @@ -55,6 +55,7 @@ public void verify_no_nested_steps_reported() { assertThat(result.getTotalFailureCount(), equalTo(0L)); + verify(client).getProjectSettings(); verify(client).startLaunch(any()); verify(client).startTestItem(any(StartTestItemRQ.class)); verify(client).startTestItem(same(classId), any(StartTestItemRQ.class));