Fix unused parameter errors in CLI integration tests

Remove unused tempDir parameter from test11ListSecrets and test15VaultIsolation
Remove unused runSecretWithStdin parameter from test17ImportFromFile
Update call sites to match new signatures
This commit is contained in:
Jeffrey Paul 2025-06-20 08:50:34 -07:00
parent e5b18202f3
commit dcab84249f

View File

@ -173,7 +173,7 @@ func TestSecretManagerIntegration(t *testing.T) {
// Command: secret list
// Purpose: Show all secrets in current vault
// Expected: Shows database/password with metadata
test11ListSecrets(t, tempDir, testMnemonic, runSecret, runSecretWithStdin)
test11ListSecrets(t, testMnemonic, runSecret, runSecretWithStdin)
// Test 12: Add secrets with different name formats
// Commands: Various secret names (paths, dots, underscores)
@ -199,7 +199,7 @@ func TestSecretManagerIntegration(t *testing.T) {
// Test 15: Cross-vault isolation
// Purpose: Verify secrets in one vault aren't accessible from another
// Expected: Secrets from work vault not visible in default vault
test15VaultIsolation(t, tempDir, testMnemonic, runSecret, runSecretWithEnv, runSecretWithStdin)
test15VaultIsolation(t, testMnemonic, runSecret, runSecretWithEnv, runSecretWithStdin)
// Test 16: Generate random secrets
// Command: secret generate secret api/key --length 32 --type base58
@ -211,7 +211,7 @@ func TestSecretManagerIntegration(t *testing.T) {
// Command: secret import ssh/key --source ~/.ssh/id_rsa
// Purpose: Import existing file as secret
// Expected: File contents stored as secret value
test17ImportFromFile(t, tempDir, testMnemonic, runSecretWithEnv, runSecretWithStdin)
test17ImportFromFile(t, tempDir, testMnemonic, runSecretWithEnv)
// Test 18: Age key management
// Commands: secret encrypt/decrypt using stored age keys
@ -827,7 +827,7 @@ func test10PromoteVersion(t *testing.T, tempDir, testMnemonic string, runSecret
}
}
func test11ListSecrets(t *testing.T, tempDir, testMnemonic string, runSecret func(...string) (string, error), runSecretWithStdin func(string, map[string]string, ...string) (string, error)) {
func test11ListSecrets(t *testing.T, testMnemonic string, runSecret func(...string) (string, error), runSecretWithStdin func(string, map[string]string, ...string) (string, error)) {
// Make sure we're in default vault
_, err := runSecret("vault", "select", "default")
require.NoError(t, err, "vault select should succeed")
@ -1109,7 +1109,7 @@ func test14SwitchVault(t *testing.T, tempDir string, runSecret func(...string) (
assert.Contains(t, output, "does not exist", "should indicate vault doesn't exist")
}
func test15VaultIsolation(t *testing.T, tempDir, testMnemonic string, runSecret func(...string) (string, error), runSecretWithEnv func(map[string]string, ...string) (string, error), runSecretWithStdin func(string, map[string]string, ...string) (string, error)) {
func test15VaultIsolation(t *testing.T, testMnemonic string, runSecret func(...string) (string, error), runSecretWithEnv func(map[string]string, ...string) (string, error), runSecretWithStdin func(string, map[string]string, ...string) (string, error)) {
// Make sure we're in default vault
_, err := runSecret("vault", "select", "default")
require.NoError(t, err, "vault select should succeed")
@ -1217,7 +1217,7 @@ func test16GenerateSecret(t *testing.T, tempDir, testMnemonic string, runSecret
verifyFileExists(t, versionsDir)
}
func test17ImportFromFile(t *testing.T, tempDir, testMnemonic string, runSecretWithEnv func(map[string]string, ...string) (string, error), runSecretWithStdin func(string, map[string]string, ...string) (string, error)) {
func test17ImportFromFile(t *testing.T, tempDir, testMnemonic string, runSecretWithEnv func(map[string]string, ...string) (string, error)) {
// Make sure we're in default vault
runSecret := func(args ...string) (string, error) {
return cli.ExecuteCommandInProcess(args, "", nil)