From 681946a480bf50f790da3cdf637efaa79c439697 Mon Sep 17 00:00:00 2001 From: James Truher Date: Wed, 22 Aug 2018 17:18:41 -0700 Subject: [PATCH] Change logic for downloading zip files based on job id --- .../CodeCoverageAutomation/Start-CodeCoverageRun.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 index f4ea749e285..21168fdd876 100644 --- a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 +++ b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 @@ -121,9 +121,14 @@ Write-LogPassThru -Message "***** New Run *****" Write-LogPassThru -Message "Forcing winrm quickconfig as it is required for remoting tests." winrm quickconfig -force -$codeCoverageZip = 'https://ci.appveyor.com/api/projects/PowerShell/powershell-f975h/artifacts/CodeCoverage.zip' -$testContentZip = 'https://ci.appveyor.com/api/projects/PowerShell/powershell-f975h/artifacts/tests.zip' -$openCoverZip = 'https://ci.appveyor.com/api/projects/PowerShell/powershell-f975h/artifacts/OpenCover.zip' +$appVeyorUri = "https://ci.appveyor.com/api" +$project = Invoke-RestMethod -Method Get -Uri "${appVeyorUri}/projects/PowerShell/powershell-f975h" +$jobId = $project.build.jobs[0].jobId + +$appVeyorBaseUri = "${appVeyorUri}/buildjobs/${jobId}/artifacts" +$codeCoverageZip = "${appVeyorBaseUri}/CodeCoverage.zip" +$testContentZip = "${appVeyorBaseUri}/tests.zip" +$openCoverZip = "${appVeyorBaseUri}/OpenCover.zip" Write-LogPassThru -Message "codeCoverageZip: $codeCoverageZip" Write-LogPassThru -Message "testcontentZip: $testContentZip"