Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance-setup Function Definitions #60102

Merged
merged 3 commits into from
Oct 6, 2021
Merged
Changes from 2 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
68 changes: 39 additions & 29 deletions eng/testing/performance/performance-setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,48 @@ Param(
)

function Verified-Move-Item {
[Parameter(Mandatory)]
[string]$Path
[Parameter(Mandatory)]
[string]$Destination

Move-Item -Path $Path -Destination $Destination
if (!$?) {
Write-Output "Failed to move $Source to $Destination"
exit 1
}
[CmdletBinding()]
param(
[Parameter(mandatory=$true)]
[string]$Path,
[Parameter(mandatory=$true)]
[string]$Destination
)

Move-Item -Path $Path -Destination $Destination
if (!$?) {
Write-Output "Failed to move $Source to $Destination"
Copy link
Member

Choose a reason for hiding this comment

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

Is this $Source supposed to be $Path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

exit 1
}
}

function Verified-Copy-Item {
[Parameter(Mandatory)]
[string]$path
[Parameter(Mandatory)]
[string]$Destination

Copy-Item -path $path $Destination
if (!$?) {
Write-Output "Failed to copy $Source to $Destination"
exit 1
}
[CmdletBinding()]
param(
[Parameter(mandatory=$true)]
[string]$Path,
[Parameter(mandatory=$true)]
[string]$Destination
)

Copy-Item -path $Path $Destination
if (!$?) {
Write-Output "Failed to copy $Path to $Destination"
exit 1
}
}

function Verify-Robocopy {
[Parameter(Mandatory)]
[string]$Source
if ($LASTEXITCODE -ne 0 -or !$?) {
Write-Output "Failed to copy ${Source}: exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
[CmdletBinding()]
param(
[Parameter(mandatory=$true)]
[string]$Source
)

if ($LASTEXITCODE -ne 0 -or !$?) {
Write-Output "Failed to copy ${Source}: exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
}

$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance")
Expand Down Expand Up @@ -188,7 +198,7 @@ if ($AndroidMono) {
{
mkdir $WorkItemDirectory
}
Verified-Copy-Item -path "$SourceDirectory\artifacts\bin\AndroidSampleApp\arm64\Release\android-arm64\publish\apk\bin\HelloAndroid.apk" $PayloadDirectory
Verified-Copy-Item -Path "$SourceDirectory\artifacts\bin\AndroidSampleApp\arm64\Release\android-arm64\publish\apk\bin\HelloAndroid.apk" $PayloadDirectory
$SetupArguments = $SetupArguments -replace $Architecture, 'arm64'
}

Expand All @@ -198,9 +208,9 @@ if ($iOSMono) {
mkdir $WorkItemDirectory
}
if($iOSLlvmBuild) {
Verified-Copy-Item -path "$SourceDirectory\iosHelloWorld\llvm" $PayloadDirectory\iosHelloWorld\llvm -Recurse
Verified-Copy-Item -Path "$SourceDirectory\iosHelloWorld\llvm" $PayloadDirectory\iosHelloWorld\llvm -Recurse
} else {
Verified-Copy-Item -path "$SourceDirectory\iosHelloWorld\nollvm" $PayloadDirectory\iosHelloWorld\nollvm -Recurse
Verified-Copy-Item -Path "$SourceDirectory\iosHelloWorld\nollvm" $PayloadDirectory\iosHelloWorld\nollvm -Recurse
}

$SetupArguments = $SetupArguments -replace $Architecture, 'arm64'
Expand Down