From 5ad99599ab0e3868bdb126be1d14b4b9944cfaee Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Wed, 27 Mar 2019 15:44:06 +0100 Subject: [PATCH] Make use of the step tracker --- test/groovy/util/LibraryLoadingTestExecutionListener.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/groovy/util/LibraryLoadingTestExecutionListener.groovy b/test/groovy/util/LibraryLoadingTestExecutionListener.groovy index cc2e58675..85b8d0c7c 100644 --- a/test/groovy/util/LibraryLoadingTestExecutionListener.groovy +++ b/test/groovy/util/LibraryLoadingTestExecutionListener.groovy @@ -90,6 +90,7 @@ class LibraryLoadingTestExecutionListener extends AbstractTestExecutionListener @Override void beforeTestClass(TestContext testContext) throws Exception { super.beforeTestClass(testContext) + StepTracker.before(testContext.testClass.getSimpleName()) def helper = LibraryLoadingTestExecutionListener.getSingletonInstance() registerDefaultAllowedMethods(helper) LibraryLoadingTestExecutionListener.START_CLASS_TRACKING = true @@ -98,6 +99,7 @@ class LibraryLoadingTestExecutionListener extends AbstractTestExecutionListener @Override void afterTestClass(TestContext testContext) throws Exception { super.afterTestClass(testContext) + StepTracker.after() PipelineTestHelper helper = LibraryLoadingTestExecutionListener.getSingletonInstance() helper.clearAllowedMethodCallbacks(LibraryLoadingTestExecutionListener.TRACKED_ON_CLASS) LibraryLoadingTestExecutionListener.TRACKED_ON_CLASS.clear() @@ -123,6 +125,7 @@ class LibraryLoadingTestExecutionListener extends AbstractTestExecutionListener void beforeTestMethod(TestContext testContext) throws Exception { super.beforeTestMethod(testContext) def testInstance = testContext.getTestInstance() + StepTracker.before(testInstance.getClass().getSimpleName()) testInstance.binding.setVariable('currentBuild', [result: 'SUCCESS', currentResult: 'SUCCESS']) PipelineTestHelper helper = LibraryLoadingTestExecutionListener.getSingletonInstance() LibraryLoadingTestExecutionListener.START_METHOD_TRACKING = true @@ -132,6 +135,7 @@ class LibraryLoadingTestExecutionListener extends AbstractTestExecutionListener void afterTestMethod(TestContext testContext) throws Exception { super.afterTestMethod(testContext) def testInstance = testContext.getTestInstance() + StepTracker.after() PipelineTestHelper helper = LibraryLoadingTestExecutionListener.getSingletonInstance() helper.clearCallStack() @@ -192,6 +196,7 @@ class LibraryLoadingTestExecutionListener extends AbstractTestExecutionListener static class PipelineTestHelperHook { def helper = new PipelineTestHelper() { + def clearAllowedMethodCallbacks(Collection c = []) { List itemsToRemove = [] c.each {