From d209c89b368b73db183566bda3004717d7a8c4fa Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 21 Nov 2019 00:13:58 +0000 Subject: [PATCH] Bug 1593034 [wpt PR 20023] - Cleanup Edge driver files after every run, a=testonly Automatic update from web-platform-tests Cleanup Edge driver files after every run (#20023) * Added task to delete msedgedriver.exe at the end of each run * Delete unzipped folder and zip file * Split up deletion tasks * Always delete Driver_Notes folder -- wpt-commits: f6d693b1796efc206c68e3a9fd4faa3aac55efaa wpt-pr: 20023 Differential Revision: https://phabricator.services.mozilla.com/D53598 UltraBlame original commit: b4ff9ba4365b7a54ad4c2ff31743555b12a289b9 --- .../tests/tools/ci/azure/cleanup_win10.yml | 22 +++++++++++++++++++ .../web-platform/tests/tools/wpt/browser.py | 8 ++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/testing/web-platform/tests/tools/ci/azure/cleanup_win10.yml b/testing/web-platform/tests/tools/ci/azure/cleanup_win10.yml index 76852b58cd39..f495a0c55453 100644 --- a/testing/web-platform/tests/tools/ci/azure/cleanup_win10.yml +++ b/testing/web-platform/tests/tools/ci/azure/cleanup_win10.yml @@ -95,3 +95,25 @@ steps: condition: always() errorActionPreference: silentlyContinue ignoreLASTEXITCODE: true + +- powershell: | + ($webdriverFiles = Get-ChildItem -PATH "$env:systemdrive\*msedgedriver.exe" -Recurse) >$null 2>$null + Write-Host "Found $($webdriverFiles.Count) msedgedriver binaries" + foreach ($file in $webdriverFiles) { + Write-Host "Deleting $file" + Remove-Item -Path $file.FullName -Force -ErrorAction SilentlyContinue + } + ($driverNotesFolder = Get-ChildItem -PATH "$env:systemdrive\*Driver_Notes" -Recurse) >$null 2>$null + foreach ($file in $driverNotesFolder) { + Write-Host "Deleting $file folder" + Remove-Item -Path $file.FullName -Recurse -Force -ErrorAction SilentlyContinue + } + ($zipFile = Get-ChildItem -PATH "$env:systemdrive\*edgedriver_*.zip" -Recurse) >$null 2>$null + foreach ($file in $zipFile) { + Write-Host "Deleting $file file" + Remove-Item -Path $file.FullName -Force -ErrorAction SilentlyContinue + } + displayName: 'Cleanup Edge driver binaries' + condition: always() + errorActionPreference: silentlyContinue + ignoreLASTEXITCODE: true \ No newline at end of file diff --git a/testing/web-platform/tests/tools/wpt/browser.py b/testing/web-platform/tests/tools/wpt/browser.py index 830855e5c0c2..5887f17997fb 100644 --- a/testing/web-platform/tests/tools/wpt/browser.py +++ b/testing/web-platform/tests/tools/wpt/browser.py @@ -874,10 +874,12 @@ def install_webdriver(self, dest=None, channel=None, browser_binary=None): if os.path.isfile(edgedriver_path): os.chmod(edgedriver_path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) + print("Delete %s file" % edgedriver_path) os.remove(edgedriver_path) - driver_notes_path = os.path.join(dest, "Driver_notes") - if os.path.isdir(driver_notes_path): - shutil.rmtree(driver_notes_path, ignore_errors=False, onerror=handle_remove_readonly) + driver_notes_path = os.path.join(dest, "Driver_notes") + if os.path.isdir(driver_notes_path): + print("Delete %s folder" % driver_notes_path) + shutil.rmtree(driver_notes_path, ignore_errors=False, onerror=handle_remove_readonly) self.logger.info("Downloading MSEdgeDriver from %s" % url) unzip(get(url).raw, dest)