mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 23:48:05 -05:00
small nits
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy/v2"
|
||||
@@ -13,8 +12,6 @@ func TestUniversalAuth_ExportSecretsWithImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "export", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -31,8 +28,6 @@ func TestServiceToken_ExportSecretsWithImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "export", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -50,8 +45,6 @@ func TestUniversalAuth_ExportSecretsWithoutImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "export", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--silent", "--include-imports=false")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -68,8 +61,6 @@ func TestServiceToken_ExportSecretsWithoutImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "export", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--silent", "--include-imports=false")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package tests
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy/v2"
|
||||
@@ -18,7 +17,6 @@ func TestServiceToken_RunCmdRecursiveAndImports(t *testing.T) {
|
||||
}
|
||||
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
@@ -36,7 +34,6 @@ func TestServiceToken_RunCmdWithImports(t *testing.T) {
|
||||
}
|
||||
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
@@ -56,7 +53,6 @@ func TestUniversalAuth_RunCmdRecursiveAndImports(t *testing.T) {
|
||||
}
|
||||
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
@@ -77,7 +73,6 @@ func TestUniversalAuth_RunCmdWithImports(t *testing.T) {
|
||||
|
||||
// remove the first few characters from the output because we don't care about the time, and it will change every time
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
@@ -97,7 +92,6 @@ func TestUniversalAuth_RunCmdWithoutImports(t *testing.T) {
|
||||
}
|
||||
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
@@ -117,7 +111,6 @@ func TestServiceToken_RunCmdWithoutImports(t *testing.T) {
|
||||
|
||||
// Remove everything before "INF" because it's not relevant to the test
|
||||
output = string(bytes.Split([]byte(output), []byte("INF"))[1])
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err = cupaloy.Snapshot(output)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy/v2"
|
||||
@@ -12,8 +11,6 @@ func TestServiceToken_GetSecretsByNameRecursive(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "TEST-SECRET-2", "FOLDER-SECRET-1", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -30,8 +27,6 @@ func TestServiceToken_GetSecretsByNameWithNotFoundSecret(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "TEST-SECRET-2", "FOLDER-SECRET-1", "DOES-NOT-EXIST", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -48,8 +43,6 @@ func TestServiceToken_GetSecretsByNameWithImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "STAGING-SECRET-2", "FOLDER-SECRET-1", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -67,8 +60,6 @@ func TestUniversalAuth_GetSecretsByNameRecursive(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "TEST-SECRET-2", "FOLDER-SECRET-1", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -86,8 +77,6 @@ func TestUniversalAuth_GetSecretsByNameWithNotFoundSecret(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "TEST-SECRET-2", "FOLDER-SECRET-1", "DOES-NOT-EXIST", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -105,8 +94,6 @@ func TestUniversalAuth_GetSecretsByNameWithImports(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "get", "TEST-SECRET-1", "STAGING-SECRET-2", "FOLDER-SECRET-1", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy/v2"
|
||||
@@ -12,8 +11,6 @@ func TestServiceToken_SecretsGetWithImportsAndRecursiveCmd(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -30,8 +27,6 @@ func TestServiceToken_SecretsGetWithoutImportsAndWithoutRecursiveCmd(t *testing.
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--token", creds.ServiceToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--include-imports=false", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -49,8 +44,6 @@ func TestUniversalAuth_SecretsGetWithImportsAndRecursiveCmd(t *testing.T) {
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -68,8 +61,6 @@ func TestUniversalAuth_SecretsGetWithoutImportsAndWithoutRecursiveCmd(t *testing
|
||||
|
||||
output, err := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", creds.EnvSlug, "--include-imports=false", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("error running CLI command: %v", err)
|
||||
}
|
||||
@@ -87,8 +78,6 @@ func TestUniversalAuth_SecretsGetWrongEnvironment(t *testing.T) {
|
||||
|
||||
output, _ := ExecuteCliCommand(FORMATTED_CLI_NAME, "secrets", "--token", creds.UAAccessToken, "--projectId", creds.ProjectID, "--env", "invalid-env", "--recursive", "--silent")
|
||||
|
||||
fmt.Printf("output: %v\n", output)
|
||||
|
||||
// Use cupaloy to snapshot test the output
|
||||
err := cupaloy.Snapshot(output)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user