From bc1aac78d39aad17c1a25960770928b0ffcb853a Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Thu, 30 Aug 2018 11:23:19 -0700 Subject: [PATCH] Change logic for downloading zip files based on job id (#7653) --- .../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 f4ea749e28..21168fdd87 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"