Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Feat: Cli integration tests -- exports
Daniel Hougaardb598dd3d477f
diff --git a/cli/test/export_test.go b/cli/test/export_test.goindex dd156fc392..a0f68fa7aa 100644--- a/cli/test/export_test.go+++ b/cli/test/export_test.go@@ -16,8 +16,9 @@ func ExportSecrets(t *testing.T, authToken string, projectId string, envSlug strrootCommand := cmd.NewRootCmd()commandOutput := new(bytes.Buffer)+ errorOutput := new(bytes.Buffer)rootCommand.SetOut(commandOutput)- rootCommand.SetErr(commandOutput)+ rootCommand.SetErr(errorOutput)args := []string{"export",@@ -25,6 +26,7 @@ func ExportSecrets(t *testing.T, authToken string, projectId string, envSlug strargs = append(args, fmt.Sprintf("--token=%s", authToken))args = append(args, fmt.Sprintf("--projectId=%s", projectId))+ args = append(args, fmt.Sprintf("--env=%s", envSlug))rootCommand.SetArgs(args)rootCommand.Execute()@@ -36,7 +38,7 @@ func ExportSecrets(t *testing.T, authToken string, projectId string, envSlug strt.Errorf("Error: %v", err)}- expectedLength := len(ALL_SECRETS) - 1 // -1 because the default path is "/", and the secret in /folder will not be found.+ expectedLength := len(DEV_SECRETS) + len(STAGING_SECRETS)assert.Len(t, secrets, expectedLength)@@ -47,7 +49,6 @@ func ExportSecrets(t *testing.T, authToken string, projectId string, envSlug strassert.Contains(t, ALL_SECRET_KEYS, secret.Key)assert.Contains(t, ALL_SECRET_VALUES, secret.Value)}-}func ExportSecretsWithoutImports(t *testing.T, authToken string, projectId string, envSlug string) {@@ -64,6 +65,7 @@ func ExportSecretsWithoutImports(t *testing.T, authToken string, projectId strinargs = append(args, fmt.Sprintf("--token=%s", authToken))args = append(args, fmt.Sprintf("--projectId=%s", projectId))+ args = append(args, fmt.Sprintf("--env=%s", envSlug))args = append(args, "--include-imports=false")rootCommand.SetArgs(args)