From cf9cd7b9eedc086d2cf75de7eaded3a62d9b0c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gro=C3=9Fmann?= Date: Thu, 25 Nov 2021 18:24:42 +0100 Subject: [PATCH 1/4] Changed update of method end time --- .../mms/tic/testerra/plugins/azuredevops/mapper/Run.java | 3 --- .../synchronize/AzureDevOpsResultSynchronizer.java | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/mapper/Run.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/mapper/Run.java index 1ebb2c5..63de73b 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/mapper/Run.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/mapper/Run.java @@ -22,11 +22,8 @@ package eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper; -import com.owlike.genson.annotation.JsonDateFormat; import eu.tsystems.mms.tic.testframework.logging.Loggable; -import java.util.Date; - /** * Created on 20.11.2020 * diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java index 1138146..7daa695 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java @@ -37,14 +37,13 @@ import eu.tsystems.mms.tic.testframework.connectors.util.AbstractCommonSynchronizer; import eu.tsystems.mms.tic.testframework.events.MethodEndEvent; import eu.tsystems.mms.tic.testframework.logging.Loggable; -import eu.tsystems.mms.tic.testframework.report.FailureCorridor; import eu.tsystems.mms.tic.testframework.report.model.context.ErrorContext; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import java.lang.reflect.Method; import java.time.Instant; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Optional; @@ -138,7 +137,9 @@ private synchronized void syncTestresult(MethodEndEvent event, Outcome outcome) result.setTestPoint(optionalPoint.get()); if (!outcome.equals(Outcome.NOT_EXECUTED)) { result.setStartedDate(event.getMethodContext().getStartTime().toInstant().toString()); - result.setCompletedDate(event.getMethodContext().getEndTime().toInstant().toString()); + // Method context contains no end time at this moment + //result.setCompletedDate(event.getMethodContext().getEndTime().toInstant().toString()); + result.setCompletedDate(new Date().toInstant().toString()); } result.setOutcome(outcome.toString()); // Priority is taken from test case, cannot change with test result From 949169825e35b6c9a65a9b0e669571bcf776b3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gro=C3=9Fmann?= Date: Fri, 26 Nov 2021 16:40:11 +0100 Subject: [PATCH 2/4] Updated synchronizer to TestStatusUpdateEvent --- .../AzureDevOpsResultSynchronizer.java | 228 +++++++++++------- .../azuredevops/tests/PlaygroundTests.java | 17 ++ src/test/resources/test.properties | 2 + 3 files changed, 158 insertions(+), 89 deletions(-) diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java index 7daa695..76ad10e 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java @@ -33,17 +33,16 @@ import eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper.RunState; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper.Testplan; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.restclient.AzureDevOpsClient; -import eu.tsystems.mms.tic.testframework.annotations.Fails; -import eu.tsystems.mms.tic.testframework.connectors.util.AbstractCommonSynchronizer; -import eu.tsystems.mms.tic.testframework.events.MethodEndEvent; +import eu.tsystems.mms.tic.testframework.events.TestStatusUpdateEvent; import eu.tsystems.mms.tic.testframework.logging.Loggable; +import eu.tsystems.mms.tic.testframework.report.Status; import eu.tsystems.mms.tic.testframework.report.model.context.ErrorContext; +import eu.tsystems.mms.tic.testframework.report.model.context.MethodContext; import org.apache.commons.lang3.exception.ExceptionUtils; import java.lang.reflect.Method; import java.time.Instant; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Optional; @@ -52,7 +51,7 @@ * * @author mgn */ -public class AzureDevOpsResultSynchronizer extends AbstractCommonSynchronizer implements Loggable { +public class AzureDevOpsResultSynchronizer implements TestStatusUpdateEvent.Listener, Loggable { private AzureDevOpsClient client = null; @@ -65,25 +64,55 @@ public AzureDevOpsResultSynchronizer() { } @Override - protected void pOnTestSuccess(MethodEndEvent event) { - log().info("Method " + event.getTestMethod().getMethodName() + " passed"); - this.syncTestresult(event, Outcome.PASSED); - } + public void onTestStatusUpdate(TestStatusUpdateEvent event) { - @Override - protected void pOnTestFailure(MethodEndEvent event) { - log().info("Method " + event.getTestMethod().getMethodName() + " failed"); - // Only the last execution of a failed tests is synced - // Otherwise the run contains more results of the same test method. - this.syncTestresult(event, Outcome.FAILED); + MethodContext methodContext = event.getMethodContext(); + Status status = methodContext.getStatus(); + switch (status) { + case PASSED: + case REPAIRED: + case RECOVERED: + log().info("Method " + methodContext.getName() + " passed."); + this.syncTestresult(event, Outcome.PASSED); + break; + case FAILED: + case FAILED_EXPECTED: + log().info("Method " + methodContext.getName() + " failed."); + this.syncTestresult(event, Outcome.FAILED); + break; + case RETRIED: + log().info("Method " + methodContext.getName() + " was retried and will not sync."); + break; + case SKIPPED: + log().info("Method " + methodContext.getName() + " skipped."); + this.syncTestresult(event, Outcome.NOT_EXECUTED); + break; + default: + log().info(String.format("Method state %s of %s cannot handle.", status.toString(), methodContext.getName())); + } } - @Override - protected void pOnTestSkip(MethodEndEvent event) { - log().info("Method " + event.getTestMethod().getMethodName() + " skipped"); - this.syncTestresult(event, Outcome.NOT_EXECUTED); - } +// @Override +// protected void pOnTestSuccess(MethodEndEvent event) { +// log().info("Method " + event.getTestMethod().getMethodName() + " passed"); +// this.syncTestresult(event, Outcome.PASSED); +// } +// +// @Override +// protected void pOnTestFailure(MethodEndEvent event) { +// log().info("Method " + event.getTestMethod().getMethodName() + " failed"); +// // Only the last execution of a failed tests is synced +// // Otherwise the run contains more results of the same test method. +// this.syncTestresult(event, Outcome.FAILED); +// +// } +// +// @Override +// protected void pOnTestSkip(MethodEndEvent event) { +// log().info("Method " + event.getTestMethod().getMethodName() + " skipped"); +// this.syncTestresult(event, Outcome.NOT_EXECUTED); +// } private void init() { this.config = AzureDevOpsConfig.getInstance(); @@ -121,72 +150,79 @@ private void init() { * @param event * @param outcome */ - private synchronized void syncTestresult(MethodEndEvent event, Outcome outcome) { - AzureTest annotation = this.getAnnotation(event); - if (this.config.isAzureSyncEnabled() && annotation != null && annotation.enabled()) { - - Points points = this.client.getPointsByTestCaseFilter(annotation.id()); - if (points.getPoints().size() > 0) { - - // Find the point with the current test plan id - Optional optionalPoint = points.getPoints().stream().filter(point -> this.config.getAzureTestPlanId() == point.getTestPlan().getId()).findFirst(); - if (optionalPoint.isPresent()) { - - // Create a new test result based on current test method - Result result = new Result(); - result.setTestPoint(optionalPoint.get()); - if (!outcome.equals(Outcome.NOT_EXECUTED)) { - result.setStartedDate(event.getMethodContext().getStartTime().toInstant().toString()); - // Method context contains no end time at this moment - //result.setCompletedDate(event.getMethodContext().getEndTime().toInstant().toString()); - result.setCompletedDate(new Date().toInstant().toString()); - } - result.setOutcome(outcome.toString()); - // Priority is taken from test case, cannot change with test result -// result.setPriority(this.getPriorityByFailureCorridor(event.getMethodContext().failureCorridorValue)); - - if (outcome.equals(Outcome.FAILED)) { - event.getMethodContext() - .readErrors() - .filter(ErrorContext::isNotOptional) - .findFirst() - .ifPresent(errorContext -> { - Throwable throwable = errorContext.getThrowable(); - final String errorMessage = throwable.getMessage(); - result.setErrorMessage(errorMessage); - result.setFailureType(this.getFailureType(event).toString()); - final String stackTrace = ExceptionUtils.getStackTrace(throwable); - result.setStackTrace(stackTrace); - }); + private synchronized void syncTestresult(TestStatusUpdateEvent event, Outcome outcome) { + Optional method = this.getMethodFromEvent(event); + + if (method.isPresent()) { + + Optional annotation = this.getAnnotation(event); + if (this.config.isAzureSyncEnabled() && annotation.isPresent()) { + + if (annotation.get().enabled()) { + + Points points = this.client.getPointsByTestCaseFilter(annotation.get().id()); + if (points.getPoints().size() > 0) { + + // Find the point with the current test plan id + Optional optionalPoint = points.getPoints().stream().filter(point -> this.config.getAzureTestPlanId() == point.getTestPlan().getId()).findFirst(); + if (optionalPoint.isPresent()) { + + // Create a new test result based on current test method + Result result = new Result(); + result.setTestPoint(optionalPoint.get()); + if (!outcome.equals(Outcome.NOT_EXECUTED)) { + result.setStartedDate(event.getMethodContext().getStartTime().toInstant().toString()); + result.setCompletedDate(event.getMethodContext().getEndTime().toInstant().toString()); + } + result.setOutcome(outcome.toString()); + // Priority is taken from test case, cannot change with test result + // result.setPriority(this.getPriorityByFailureCorridor(event.getMethodContext().failureCorridorValue)); + + if (outcome.equals(Outcome.FAILED)) { + event.getMethodContext() + .readErrors() + .filter(ErrorContext::isNotOptional) + .findFirst() + .ifPresent(errorContext -> { + Throwable throwable = errorContext.getThrowable(); + final String errorMessage = throwable.getMessage(); + result.setErrorMessage(errorMessage); + result.setFailureType(this.getFailureType(event).toString()); + final String stackTrace = ExceptionUtils.getStackTrace(throwable); + result.setStackTrace(stackTrace); + }); + } + + List resultList = new ArrayList<>(); + resultList.add(result); + this.client.addResult(resultList, this.currentRunId); + + } else { + log().warn(String.format( + "Cannot sync %s: Testcase with ID %s is not mapped to test plan %s", + method.get().getName(), + annotation.get().id(), + this.config.getAzureTestPlanId() + )); + } + + } else { + log().warn(String.format( + "Cannot sync %s: Testcase with ID %s was not added to a test plan.", + method.get().getName(), + annotation.get().id())); } - List resultList = new ArrayList<>(); - resultList.add(result); - this.client.addResult(resultList, this.currentRunId); - - } else { - log().warn(String.format( - "Cannot sync %s: Testcase with ID %s is not mapped to test plan %s", - event.getTestMethod().getMethodName(), - annotation.id(), - this.config.getAzureTestPlanId() - )); + } // end method enabled sync + else { + log().info(String.format("Sync of %s is deactivated.", method.get().getName())); } - } else { - log().warn(String.format( - "Cannot sync %s: Testcase with ID %s was not added to a test plan.", - event.getTestMethod().getMethodName(), - annotation.id())); - } + } // end active sync and annotation found + + } // end method.isPresent + - } - if (annotation != null && !annotation.enabled()) { - log().info(String.format( - "Sync of %s is deactivated.", - event.getTestMethod().getMethodName() - )); - } } public void shutdown() { @@ -206,23 +242,37 @@ public void shutdown() { } } - private AzureTest getAnnotation(MethodEndEvent event) { - final Method method = event.getTestResult().getMethod().getConstructorOrMethod().getMethod(); - if (method.isAnnotationPresent(AzureTest.class)) { - return method.getAnnotation(AzureTest.class); + private Optional getAnnotation(TestStatusUpdateEvent event) { + Optional methodFromEvent = this.getMethodFromEvent(event); + if (methodFromEvent.isPresent() && methodFromEvent.get().isAnnotationPresent(AzureTest.class)) { + return Optional.of(methodFromEvent.get().getAnnotation(AzureTest.class)); } else { log().info("No annoation found for sync results with Azure DevOps"); - return null; + return Optional.empty(); } } - private FailureType getFailureType(MethodEndEvent event) { - final Method method = event.getTestResult().getMethod().getConstructorOrMethod().getMethod(); - if (method.isAnnotationPresent(Fails.class)) { + private Optional getMethodFromEvent(TestStatusUpdateEvent event) { + return event.getMethodContext().getTestNgResult() + .map(iTestResult -> iTestResult.getMethod().getConstructorOrMethod().getMethod()); + } + + private FailureType getFailureType(TestStatusUpdateEvent event) { + if (event.getMethodContext().getStatus() == Status.FAILED_EXPECTED) { return FailureType.KNOWN_ISSUE; } else { return FailureType.NEW_ISSUE; } } +// private FailureType getFailureType(MethodEndEvent event) { +// final Method method = event.getTestResult().getMethod().getConstructorOrMethod().getMethod(); +// if (method.isAnnotationPresent(Fails.class)) { +// return FailureType.KNOWN_ISSUE; +// } else { +// return FailureType.NEW_ISSUE; +// } +// } + + } diff --git a/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java b/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java index afef2f8..751549c 100644 --- a/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java +++ b/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java @@ -24,6 +24,7 @@ import eu.tsystems.mms.tic.testerra.plugins.azuredevops.annotation.AzureTest; import eu.tsystems.mms.tic.testframework.annotations.Fails; +import eu.tsystems.mms.tic.testframework.execution.testng.RetryAnalyzer; import eu.tsystems.mms.tic.testframework.testing.TesterraTest; import eu.tsystems.mms.tic.testframework.utils.TimerUtils; import org.testng.Assert; @@ -31,6 +32,7 @@ import org.testng.annotations.Test; import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicInteger; /** * Created on 26.11.2020 @@ -61,4 +63,19 @@ public void test_Passed02() { Assert.assertTrue(false, "Mega exception"); } + AtomicInteger counter = new AtomicInteger(0); + + @AzureTest(id = 2284) + @Test(priority = 6) + public void test_03RetriedTest() { + this.counter.incrementAndGet(); + if (counter.get() == 1) { + // Message is already defined in test.properties + Assert.assertTrue(false, "retry_for_azuredevops_connector"); + } else { + Assert.assertTrue(true); + } + + } + } diff --git a/src/test/resources/test.properties b/src/test/resources/test.properties index 4f68128..5eefdec 100644 --- a/src/test/resources/test.properties +++ b/src/test/resources/test.properties @@ -1 +1,3 @@ tt.report.name=DemoAzureDevops + +tt.failed.tests.if.throwable.messages=retry_for_azuredevops_connector From 9167edb979efa5e85601a381d428bfd1952ace3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gro=C3=9Fmann?= Date: Fri, 26 Nov 2021 17:23:27 +0100 Subject: [PATCH 3/4] Fixed new synchronizer --- .../azuredevops/hook/AzureDevOpsConnectorHook.java | 4 ++-- .../synchronize/AzureDevOpsResultSynchronizer.java | 12 ++++++++++-- .../plugins/azuredevops/tests/PlaygroundTests.java | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/hook/AzureDevOpsConnectorHook.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/hook/AzureDevOpsConnectorHook.java index e89340e..d7a8ed0 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/hook/AzureDevOpsConnectorHook.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/hook/AzureDevOpsConnectorHook.java @@ -24,7 +24,6 @@ import eu.tsystems.mms.tic.testerra.plugins.azuredevops.synchronize.AzureDevOpsResultSynchronizer; import eu.tsystems.mms.tic.testframework.hooks.ModuleHook; -import eu.tsystems.mms.tic.testframework.logging.Loggable; import eu.tsystems.mms.tic.testframework.report.TesterraListener; /** @@ -32,7 +31,7 @@ * * @author mgn */ -public class AzureDevOpsConnectorHook implements ModuleHook, Loggable { +public class AzureDevOpsConnectorHook implements ModuleHook { private static AzureDevOpsResultSynchronizer synchronizer; @@ -40,6 +39,7 @@ public class AzureDevOpsConnectorHook implements ModuleHook, Loggable { public void init() { synchronizer = new AzureDevOpsResultSynchronizer(); TesterraListener.getEventBus().register(synchronizer); + } @Override diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java index 76ad10e..09155b8 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java @@ -22,6 +22,7 @@ package eu.tsystems.mms.tic.testerra.plugins.azuredevops.synchronize; +import com.google.common.eventbus.Subscribe; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.annotation.AzureTest; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.config.AzureDevOpsConfig; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper.FailureType; @@ -33,11 +34,13 @@ import eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper.RunState; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.mapper.Testplan; import eu.tsystems.mms.tic.testerra.plugins.azuredevops.restclient.AzureDevOpsClient; +import eu.tsystems.mms.tic.testframework.annotations.Fails; import eu.tsystems.mms.tic.testframework.events.TestStatusUpdateEvent; import eu.tsystems.mms.tic.testframework.logging.Loggable; import eu.tsystems.mms.tic.testframework.report.Status; import eu.tsystems.mms.tic.testframework.report.model.context.ErrorContext; import eu.tsystems.mms.tic.testframework.report.model.context.MethodContext; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import java.lang.reflect.Method; @@ -64,6 +67,7 @@ public AzureDevOpsResultSynchronizer() { } @Override + @Subscribe public void onTestStatusUpdate(TestStatusUpdateEvent event) { MethodContext methodContext = event.getMethodContext(); @@ -185,9 +189,14 @@ private synchronized void syncTestresult(TestStatusUpdateEvent event, Outcome ou .findFirst() .ifPresent(errorContext -> { Throwable throwable = errorContext.getThrowable(); - final String errorMessage = throwable.getMessage(); + String errorMessage = throwable.getMessage(); + Optional fails = event.getMethodContext().getFailsAnnotation(); + if (fails.isPresent() && StringUtils.isNotBlank(fails.get().description())) { + errorMessage += "\n\nKnown issue: " + fails.get().description(); + } result.setErrorMessage(errorMessage); result.setFailureType(this.getFailureType(event).toString()); + event.getMethodContext().getFailsAnnotation().get().description(); final String stackTrace = ExceptionUtils.getStackTrace(throwable); result.setStackTrace(stackTrace); }); @@ -222,7 +231,6 @@ private synchronized void syncTestresult(TestStatusUpdateEvent event, Outcome ou } // end method.isPresent - } public void shutdown() { diff --git a/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java b/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java index 751549c..cf92180 100644 --- a/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java +++ b/src/test/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/tests/PlaygroundTests.java @@ -57,7 +57,7 @@ public void test_Passed01() { @Test @AzureTest(id = 2284) -// @Fails(description = "Das ist halt ein alter Bug.") + @Fails(description = "Das ist halt ein alter Bug.") public void test_Passed02() { TimerUtils.sleep(5555, "Wait some time..."); Assert.assertTrue(false, "Mega exception"); From 932e62d3753337c6cafe49eab55e5077798abd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gro=C3=9Fmann?= Date: Fri, 26 Nov 2021 17:29:58 +0100 Subject: [PATCH 4/4] Cleanup, update dependencies --- build.gradle | 10 +++--- .../AzureDevOpsResultSynchronizer.java | 33 +------------------ 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/build.gradle b/build.gradle index 13d1189..73a998f 100644 --- a/build.gradle +++ b/build.gradle @@ -28,13 +28,13 @@ apply from: rootProject.file('publish.gradle') dependencies { compileOnly 'io.testerra:core:' + testerraCompileVersion - implementation 'io.testerra:surefire-connector:' + testerraCompileVersion +// implementation 'io.testerra:surefire-connector:' + testerraCompileVersion - implementation 'org.apache.commons:commons-lang3:3.9' - implementation 'org.apache.httpcomponents:httpcore:4.4.13' + implementation 'org.apache.commons:commons-lang3:3.12.0' + implementation 'org.apache.httpcomponents:httpcore:4.4.14' - implementation 'org.glassfish.jersey.core:jersey-client:2.32' - implementation 'org.glassfish.jersey.inject:jersey-hk2:2.32' + implementation 'org.glassfish.jersey.core:jersey-client:2.35' + implementation 'org.glassfish.jersey.inject:jersey-hk2:2.35' // implementation 'org.glassfish.jersey.media:jersey-media-json-jackson:2.32' // Better JSON mapper for Jersey implementation 'com.owlike:genson:1.6' diff --git a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java index 09155b8..e1a223b 100644 --- a/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java +++ b/src/main/java/eu/tsystems/mms/tic/testerra/plugins/azuredevops/synchronize/AzureDevOpsResultSynchronizer.java @@ -1,7 +1,7 @@ /* * Testerra * - * (C) 2020, Martin Großmann, T-Systems Multimedia Solutions GmbH, Deutsche Telekom AG + * (C) 2021, Martin Großmann, T-Systems Multimedia Solutions GmbH, Deutsche Telekom AG * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache @@ -97,27 +97,6 @@ public void onTestStatusUpdate(TestStatusUpdateEvent event) { } -// @Override -// protected void pOnTestSuccess(MethodEndEvent event) { -// log().info("Method " + event.getTestMethod().getMethodName() + " passed"); -// this.syncTestresult(event, Outcome.PASSED); -// } -// -// @Override -// protected void pOnTestFailure(MethodEndEvent event) { -// log().info("Method " + event.getTestMethod().getMethodName() + " failed"); -// // Only the last execution of a failed tests is synced -// // Otherwise the run contains more results of the same test method. -// this.syncTestresult(event, Outcome.FAILED); -// -// } -// -// @Override -// protected void pOnTestSkip(MethodEndEvent event) { -// log().info("Method " + event.getTestMethod().getMethodName() + " skipped"); -// this.syncTestresult(event, Outcome.NOT_EXECUTED); -// } - private void init() { this.config = AzureDevOpsConfig.getInstance(); @@ -273,14 +252,4 @@ private FailureType getFailureType(TestStatusUpdateEvent event) { } } -// private FailureType getFailureType(MethodEndEvent event) { -// final Method method = event.getTestResult().getMethod().getConstructorOrMethod().getMethod(); -// if (method.isAnnotationPresent(Fails.class)) { -// return FailureType.KNOWN_ISSUE; -// } else { -// return FailureType.NEW_ISSUE; -// } -// } - - }