Skip to content

Commit

Permalink
Merge pull request #2389 from janegilring/arcbox_3.0_task_930_integra…
Browse files Browse the repository at this point in the history
…tion_tests

Arcbox 3.0 task 930 integration tests
  • Loading branch information
janegilring authored Jan 27, 2024
2 parents ee2cfc3 + 686282a commit 5f3cf6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ stages:
ScriptType: FilePath
azurePowerShellVersion: 'LatestVersion'
ScriptPath: 'azure_jumpstart_arcbox/artifacts/integration_tests/scripts/Wait-ArcBoxDeployment.ps1'
ScriptArguments: -ResourceGroupName $(ResourceGroupName)
ScriptArguments: -ResourceGroupName $(ResourceGroupName) -githubAccount $(githubAccount) -githubBranch $(githubBranch)

- task: AzurePowerShell@5
displayName: 'Download Pester test-results from storage account to pipeline agent'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Start-Transcript -Path C:\ArcBox\logs\Get-PesterResult.log -Force

$Env:ArcBoxDir = "C:\ArcBox"
$Env:ArcBoxLogsDir = "$Env:ArcBoxDir\Logs"
$Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests"

Start-Transcript -Path "$Env:ArcBoxLogsDir\Get-PesterResult.log" -Force

Write-Output "Get-PesterResult.ps1 started in $(hostname.exe) as user $(whoami.exe) at $(Get-Date)"

$timeout = New-TimeSpan -Minutes 180
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
param(
[Parameter(Mandatory=$true)]
[string]$ResourceGroupName
[string]$ResourceGroupName,
[Parameter(Mandatory=$true)]
[string]$githubAccount,
[Parameter(Mandatory=$true)]
[string]$githubBranch
)

Write-Host "Starting VM Run Command to wait for deployment and retrieve Pester test results from ArcBox-Client in resource group $ResourceGroupName"

$Location = (Get-AzVM -ResourceGroupName $ResourceGroupName).Location
Set-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName ArcBox-Client -RunCommandName RetrievePesterResults -Location $Location -SourceScriptUri "https://raw.githubusercontent.com/microsoft/azure_arc/arcbox_3.0/azure_jumpstart_arcbox/artifacts/integration_tests/scripts/Send-PesterResult.ps1" -AsyncExecution
Set-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName ArcBox-Client -RunCommandName RetrievePesterResults -Location $Location -SourceScriptUri "https://raw.githubusercontent.com/$githubAccount/azure_arc/$githubBranch/azure_jumpstart_arcbox/artifacts/integration_tests/scripts/Send-PesterResult.ps1" -AsyncExecution

do {
$job = Get-AzVMRunCommand -ResourceGroupName $ResourceGroupName -VMName ArcBox-Client -RunCommandName RetrievePesterResults -Expand InstanceView
Expand Down
3 changes: 3 additions & 0 deletions azure_jumpstart_arcbox/artifacts/tests/Invoke-Test.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
$Env:ArcBoxDir = "C:\ArcBox"
$Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests"

Invoke-Pester -Path "$Env:ArcBoxTestsDir\common.tests.ps1" -Output Detailed -PassThru -OutVariable tests_common
$tests_passed = $tests_common.Passed.Count
$tests_failed = $tests_common.Failed.Count
Expand Down

0 comments on commit 5f3cf6b

Please sign in to comment.