From c10c79d4f4d1021d632bf5020d28fee8f7ddda15 Mon Sep 17 00:00:00 2001 From: Simone Date: Sun, 10 May 2026 21:59:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(test):=20Fix=20=C2=A73.3=20e2e=20=E2=80=94?= =?UTF-8?q?=20pipeline=20pollution=20+=20SSH=20URL=20not=20usable=20in=20g?= =?UTF-8?q?uest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs: 1. Run-Test used '& $orchestrator @params' without Out-Host — orchestrator output collected in function pipeline, mixed with returned hashtable → caller received array instead of hashtable → .Success property lookup threw under StrictMode. Fix: pipe to Out-Host. 2. RepoUrl was ssh://gitea-ci/... (SSH config alias) — alias exists only on host SSH config, not in guest VM. Guest-side clone (§3.3) needs HTTP URL directly reachable from inside the VM. Fix: separate -HostRepoUrl / -GuestRepoUrl params, inject per mode. Co-Authored-By: Claude Sonnet 4.6 --- scripts/Test-E2E-Section3.3.ps1 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/Test-E2E-Section3.3.ps1 b/scripts/Test-E2E-Section3.3.ps1 index 195010b..dd9fa66 100644 --- a/scripts/Test-E2E-Section3.3.ps1 +++ b/scripts/Test-E2E-Section3.3.ps1 @@ -26,6 +26,11 @@ Path to template VMX. Default: env:GITEA_CI_TEMPLATE_PATH or F:\CI\Templates\WinBuild2025\WinBuild2025.vmx +.PARAMETER GuestRepoUrl + HTTP(S) URL for guest-side clone. Must be reachable from inside the VM. + Default: https://gitea.emulab.it/Simone/nsis-plugin-nsinnounp.git + NOTE: ssh://gitea-ci alias works only on the host (SSH config), not inside the VM. + .PARAMETER SkipBaseline If set, skip baseline run and only run with -UseGitClone. @@ -51,6 +56,10 @@ param( if ($env:GITEA_CI_TEMPLATE_PATH) { $env:GITEA_CI_TEMPLATE_PATH } else { 'F:\CI\Templates\WinBuild2025\WinBuild2025.vmx' } ), + # URL for host-side clone (SSH alias works on host) + [string] $HostRepoUrl = 'ssh://gitea-ci/Simone/nsis-plugin-nsinnounp.git', + # URL for guest-side clone (must be HTTP reachable from inside VM — SSH alias not available in guest) + [string] $GuestRepoUrl = 'https://gitea.emulab.it/Simone/nsis-plugin-nsinnounp.git', [switch] $SkipBaseline, [switch] $SkipGuestClone ) @@ -61,7 +70,7 @@ $ErrorActionPreference = 'Stop' $scriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent $orchestrator = Join-Path $scriptDir 'Invoke-CIJob.ps1' -# Common parameters for both runs +# Common parameters (RepoUrl set per-mode below) $commonParams = @{ Branch = $Branch TemplatePath = $TemplatePath @@ -69,7 +78,6 @@ $commonParams = @{ BuildCommand = 'python build_plugin.py --final --dist-dir dist' GuestArtifactSource = 'dist' GuestCredentialTarget = 'BuildVMGuest' - RepoUrl = 'ssh://gitea-ci/Simone/nsis-plugin-nsinnounp.git' } function Format-Elapsed { @@ -102,13 +110,17 @@ function Run-Test { $params['JobId'] = $JobId if ($UseGitClone) { $params['UseGitClone'] = $true + $params['RepoUrl'] = $script:GuestRepoUrl # HTTP URL reachable from inside VM + } else { + $params['RepoUrl'] = $script:HostRepoUrl # SSH alias — works on host } $startTime = Get-Date $exitCode = 0 try { - & $orchestrator @params + # Pipe to Out-Host so orchestrator output doesn't pollute this function's pipeline + & $orchestrator @params | Out-Host $exitCode = $LASTEXITCODE } catch {