Revert "test(commons): make the macOS keychain probe path testable on every host"

This reverts commit 047eb197a4.
This commit is contained in:
Claude
2026-09-13 11:59:46 +00:00
parent 2afe9b9221
commit 5dcaa0bf5d
2 changed files with 1 additions and 12 deletions
@@ -240,14 +240,6 @@ actual class SecureKeyStorage private actual constructor() {
}
}
/**
* Whether the macOS `security` CLI probe is used for strict lookups. Reads
* `os.name` by default; tests that wire [macSecurityLookup] set it to `true`
* so the probe path is exercised on every host, not only on a Mac (the
* vault test suite was red on Linux CI for exactly this reason).
*/
internal var isMacOs: () -> Boolean = { defaultIsMacOs() }
/**
* Test seam: overridable strategy for the strict macOS lookup. Production wires
* to [defaultMacSecurityLookup] which spawns `/usr/bin/security`. Tests replace
@@ -1015,7 +1007,7 @@ internal fun parseMacSecurityFindResult(
}
}
private fun defaultIsMacOs(): Boolean = System.getProperty("os.name").orEmpty().startsWith("Mac")
private fun isMacOs(): Boolean = System.getProperty("os.name").orEmpty().startsWith("Mac")
/**
* Production implementation: spawn `/usr/bin/security` and read exit code + streams.
@@ -375,9 +375,6 @@ class SecureKeyStorageVaultTest {
storage: SecureKeyStorage,
backend: CountingKeyring,
) {
// Force the mac probe path regardless of the host OS: the point of the
// fake is to exercise it, and CI runs this suite on Linux.
storage.isMacOs = { true }
storage.macSecurityLookup = { service, account ->
backend.store[service to account]
?.let { MacSecurityResult.Found(it) }