Skip to content

Commit

Permalink
Merge pull request #190 from Jake151/master
Browse files Browse the repository at this point in the history
Calling Invoke-ExecuteCommand bug fix - Invalid parameter order.
  • Loading branch information
clr2of8 authored Apr 24, 2024
2 parents 392533b + 39b80ef commit 20ba652
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Private/Invoke-CheckPrereqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function Invoke-CheckPrereqs ($test, $isElevated, $executionPlatform, $customInp
$executor = Get-PrereqExecutor $test
$final_command = Merge-InputArgs $dep.prereq_command $test $customInputArgs $PathToAtomicsFolder
if ($executor -ne "powershell") { $final_command = ($final_Command.trim()).Replace("`n", " && ") }
$res = Invoke-ExecuteCommand $final_command $executor $executionPlatform $TimeoutSeconds $session
$res = Invoke-ExecuteCommand -FinalCommand $final_command -Executor $executor -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session
$description = Merge-InputArgs $dep.description $test $customInputArgs $PathToAtomicsFolder
if ($res.ExitCode -ne 0) {
$FailureReasons.add($description) | Out-Null
Expand Down
10 changes: 5 additions & 5 deletions Public/Invoke-AtomicTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,14 @@ function Invoke-AtomicTest {
$final_command_prereq = Merge-InputArgs $dep.prereq_command $test $InputArgs $PathToPayloads
if ($executor -ne "powershell") { $final_command_prereq = ($final_command_prereq.trim()).Replace("`n", " && ") }
$final_command_get_prereq = Merge-InputArgs $dep.get_prereq_command $test $InputArgs $PathToPayloads
$res = Invoke-ExecuteCommand $final_command_prereq $executor $executionPlatform $TimeoutSeconds $session -Interactive:$true
$res = Invoke-ExecuteCommand -FinalCommand $final_command_prereq -Executor $executor -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session -Interactive:$true

if ($res.ExitCode -eq 0) {
Write-KeyValue "Prereq already met: " $description
}
else {
$res = Invoke-ExecuteCommand $final_command_get_prereq $executor $executionPlatform $TimeoutSeconds $session -Interactive:$Interactive
$res = Invoke-ExecuteCommand $final_command_prereq $executor $executionPlatform $TimeoutSeconds $session -Interactive:$true
$res = Invoke-ExecuteCommand -FinalCommand $final_command_get_prereq -Executor $executor -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session -Interactive:$Interactive
$res = Invoke-ExecuteCommand -FinalCommand $final_command_prereq -Executor $executor -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session -Interactive:$true
if ($res.ExitCode -eq 0) {
Write-KeyValue "Prereq successfully met: " $description
}
Expand All @@ -479,7 +479,7 @@ function Invoke-AtomicTest {
Write-KeyValue "Executing cleanup for test: " $testId
$final_command = Merge-InputArgs $test.executor.cleanup_command $test $InputArgs $PathToPayloads
if (Get-Command 'Invoke-ARTPreAtomicCleanupHook' -errorAction SilentlyContinue) { Invoke-ARTPreAtomicCleanupHook $test $InputArgs }
$res = Invoke-ExecuteCommand $final_command $test.executor.name $executionPlatform $TimeoutSeconds $session -Interactive:$Interactive
$res = Invoke-ExecuteCommand -FinalCommand $final_command -Executor $test.executor.name -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session -Interactive:$Interactive
Write-KeyValue "Done executing cleanup for test: " $testId
if (Get-Command 'Invoke-ARTPostAtomicCleanupHook' -errorAction SilentlyContinue) { Invoke-ARTPostAtomicCleanupHook $test $InputArgs }
if ($(Test-IncludesTerraform $AT $testCount)) {
Expand All @@ -491,7 +491,7 @@ function Invoke-AtomicTest {
$startTime = Get-Date
$final_command = Merge-InputArgs $test.executor.command $test $InputArgs $PathToPayloads
if (Get-Command 'Invoke-ARTPreAtomicHook' -errorAction SilentlyContinue) { Invoke-ARTPreAtomicHook $test $InputArgs }
$res = Invoke-ExecuteCommand $final_command $test.executor.name $test.executor.elevation_required $can_sudo $executionPlatform $TimeoutSeconds $session -Interactive:$Interactive
$res = Invoke-ExecuteCommand -FinalCommand $final_command -Executor $test.executor.name -Elevationreq $test.executor.elevation_required -Can_sudo $can_sudo -ExecutionPlatform $executionPlatform -TimeoutSeconds $TimeoutSeconds -Session $session -Interactive:$Interactive
Write-Host "Exit code: $($res.ExitCode)"
if (Get-Command 'Invoke-ARTPostAtomicHook' -errorAction SilentlyContinue) { Invoke-ARTPostAtomicHook $test $InputArgs }
$stopTime = Get-Date
Expand Down

0 comments on commit 20ba652

Please sign in to comment.