From 0e6bc91861188e9cc37fdfdd59a8bb85ca7d934e Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Mon, 3 Aug 2020 11:46:34 -0400 Subject: [PATCH] Delete screenshots folder in fragile test first (#735) It is not clear to me why this folder is deleted in standardTest first, presumably this is done when the webdriver tests were part of standardTest? Also not clear to me is why screenshots are only deleted in presubmits but not locally. At least on my workstation standardTest runs after fragileTest, just like in kokoro, so it should have deleted the screenshots folder, but it didn't. Regardless, the correct thing to do is to delete this folder first in fragileTest so that it doesn't interfere with the results. --- core/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 379565399..8f57d1816 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -705,6 +705,10 @@ task fragileTest(type: FilteringTest) { // Run every test class in a freshly started process. forkEvery 1 + + doFirst { + new File(screenshotsDir).deleteDir() + } } task outcastTest(type: FilteringTest) { @@ -897,10 +901,6 @@ task standardTest(type: FilteringTest) { systemProperty 'test.projectRoot', rootProject.projectRootDir systemProperty 'test.resourcesDir', resourcesDir - - doFirst { - new File(screenshotsDir).deleteDir() - } } test {