small nits

This commit is contained in:
Maidul Islam
2024-04-22 14:36:33 -04:00
parent 519d6f98a2
commit de21b44486
4 changed files with 0 additions and 40 deletions

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -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)
}

View File

@@ -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 {