test(secrets): fix Windows failures - skippable permission tests, release SQLite pools before delete (scadaproj#27)
The two Unix-permission tests called Skip.IfNot from a plain [Fact] (xunit v2 + Xunit.SkippableFact) so they failed on Windows; now [SkippableFact]. Resolver_Works_EndToEnd_ThroughDi calls SqliteConnection.ClearAllPools() before deleting its temp DB. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
+1
-1
@@ -232,7 +232,7 @@ public sealed class BundleFlowTests : IDisposable
|
||||
Assert.Null(await target.Store.GetAsync(new SecretName("svc/cross"), CancellationToken.None)); // untouched
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SkippableFact]
|
||||
public async Task Import_source_key_file_permission_denied_renders_friendly_error_without_importing()
|
||||
{
|
||||
Skip.IfNot(!OperatingSystem.IsWindows(), "Unix permission bits are exercised via UnixFileMode.");
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ public sealed class KekDoctorFlowTests : IAsyncLifetime, IDisposable
|
||||
Assert.Equal(_kekA.KekId, (await GetAsync("svc/a")).KekId); // nothing changed
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SkippableFact]
|
||||
public async Task File_old_key_source_permission_denied_renders_friendly_error_and_still_re_diagnoses()
|
||||
{
|
||||
Skip.IfNot(!OperatingSystem.IsWindows(), "Unix permission bits are exercised via UnixFileMode.");
|
||||
|
||||
+2
@@ -116,6 +116,8 @@ public sealed class AddZbSecretsTests
|
||||
finally
|
||||
{
|
||||
Environment.SetEnvironmentVariable(envVar, null);
|
||||
// Pooled SQLite handles keep the file open (Windows cannot delete it) - release them first.
|
||||
Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools();
|
||||
File.Delete(dbPath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user