mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
Revert "test(commons): make the macOS keychain probe path testable on every host"
This reverts commit 047eb197a4.
This commit is contained in:
+1
-9
@@ -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.
|
||||
|
||||
-3
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user