Skip to content

Commit

Permalink
Bug 1593034 [wpt PR 20023] - Cleanup Edge driver files after every ru…
Browse files Browse the repository at this point in the history
…n, 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
  • Loading branch information
marco-c committed Nov 21, 2019
1 parent 5886087 commit d209c89
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
22 changes: 22 additions & 0 deletions testing/web-platform/tests/tools/ci/azure/cleanup_win10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions testing/web-platform/tests/tools/wpt/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d209c89

Please sign in to comment.