Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,13 @@ function New-TestPackage
Write-Verbose -Message "Creating destination folder: $Destination"
}

$packageRoot = Join-Path $env:TEMP ('TestPackage-' + (new-guid))
$rootFolder = $env:TEMP

if (-not $rootFolder -and $env:TF_BUILD) {
$rootFolder = $env:AGENT_WORKFOLDER
}

$packageRoot = Join-Path $rootFolder ('TestPackage-' + (new-guid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have both $env:Temp and $env:TF_BUILD be null? Maybe we should have a Test-Path here and throw an error message ... "package path cannot be found"?

Copy link
Member Author

@adityapatwardhan adityapatwardhan Oct 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$env:TEMP should be set in most cases. VSTS macOS hosts seem to be the only place where it is not set. $env:TF_BUILD is always set in VSTS builds. I will keep this as is for now. If we see problems we can address them.

$null = New-Item -ItemType Directory -Path $packageRoot -Force
$packagePath = Join-Path $Destination "TestPackage.zip"

Expand Down