mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-17 08:47:47 +00:00
fix(ci): fix xunit test, net48 build isolation, mock server check, Pester config
- Update BaseUrl test to expect trailing slash (matches code change) - Revert upload-artifact to v4 (v5 doesn't exist yet) - Build net48 job restores only src/test projects (excludes MockServer) - MockServer.Tests.ps1: fix net10.0 -> net9.0 DLL paths, fix build check - Unit tests: use New-PesterConfiguration instead of -CI flag (fixes AmbiguousParameterSet on PS 5.1), exclude MockIntegration tag Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,7 @@ namespace PSProxmoxVE.Core.Tests.Authentication
|
||||
{
|
||||
var session = new PveSession(TestHostname, TestPort, false, "root@pam!mytoken=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||
|
||||
Assert.Equal($"https://{TestHostname}:{TestPort}/api2/json", session.BaseUrl);
|
||||
Assert.Equal($"https://{TestHostname}:{TestPort}/api2/json/", session.BaseUrl);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -20,17 +20,20 @@ BeforeAll {
|
||||
|
||||
# Find the built module DLL
|
||||
$dllSearchPaths = @(
|
||||
(Join-Path $PSScriptRoot '../../PSProxmoxVE.MockServer/bin/Release/net10.0/PSProxmoxVE.MockServer.dll'),
|
||||
(Join-Path $PSScriptRoot '../../PSProxmoxVE.MockServer/bin/Debug/net10.0/PSProxmoxVE.MockServer.dll')
|
||||
(Join-Path $PSScriptRoot '../../PSProxmoxVE.MockServer/bin/Release/net9.0/PSProxmoxVE.MockServer.dll'),
|
||||
(Join-Path $PSScriptRoot '../../PSProxmoxVE.MockServer/bin/Debug/net9.0/PSProxmoxVE.MockServer.dll')
|
||||
)
|
||||
$mockServerDll = $dllSearchPaths | Where-Object { Test-Path $_ } | Select-Object -First 1
|
||||
|
||||
if (-not $mockServerDll) {
|
||||
# Build it
|
||||
$buildOutput = dotnet build $mockServerProject --configuration Release 2>&1
|
||||
$buildOutput = dotnet build $mockServerProject --configuration Release 2>&1 | Out-String
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to build mock server (exit code $LASTEXITCODE): $buildOutput"
|
||||
}
|
||||
$mockServerDll = $dllSearchPaths | Where-Object { Test-Path $_ } | Select-Object -First 1
|
||||
if (-not $mockServerDll) {
|
||||
throw "Failed to build mock server: $buildOutput"
|
||||
throw "Mock server build succeeded but DLL not found at expected paths: $($dllSearchPaths -join ', ')"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user