Feat: Integration tests

This commit is contained in:
Daniel Hougaard
2024-04-17 19:33:51 +02:00
parent 12d5fb1043
commit bcb3eaab74
5 changed files with 334 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package util
import (
"encoding/json"
"fmt"
"os"
"github.com/Infisical/infisical-merge/packages/models"
"github.com/spf13/cobra"
)
func HandleSendTestSecrets(cmd *cobra.Command, secrets []models.SingleEnvironmentVariable) {
isTestMode := os.Getenv("TEST_MODE")
if isTestMode != "true" {
return
}
jsonOut, err := json.Marshal(secrets)
if err != nil {
HandleError(err, "Unable to marshal secrets")
}
fmt.Fprint(cmd.OutOrStdout(), string(jsonOut))
}