Skip to content

Commit

Permalink
updating acceptance test to use custom namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
enekofb committed Oct 25, 2023
1 parent a2ea0a5 commit aeb36f8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cmd/gitops/app/bootstrap/cmd_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ const (
defaultInterval = time.Second
)

var fluxSystemNamespace = corev1.Namespace{
TypeMeta: metav1.TypeMeta{
Kind: "Namespace",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "flux-system",
},
}

func createEntitlementSecretFromEnv(t *testing.T, namespace string) corev1.Secret {

username := os.Getenv("WGE_ENTITLEMENT_USERNAME")
Expand Down Expand Up @@ -93,7 +83,17 @@ func TestBootstrapCmd(t *testing.T) {
Log: testLog,
}

_ = k8sClient.Create(context.Background(), &fluxSystemNamespace)
var bootstrappingNamespace = corev1.Namespace{
TypeMeta: metav1.TypeMeta{
Kind: "Namespace",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
},
}

_ = k8sClient.Create(context.Background(), &bootstrappingNamespace)

tests := []struct {
name string
Expand Down Expand Up @@ -139,6 +139,7 @@ func TestBootstrapCmd(t *testing.T) {
bootstrapCmdArgs := []string{"bootstrap"}
bootstrapCmdArgs = append(bootstrapCmdArgs, tt.flags...)
cmd.SetArgs(bootstrapCmdArgs)
fmt.Println(bootstrapCmdArgs)

err := cmd.Execute()
if tt.expectedErrorStr != "" {
Expand Down

0 comments on commit aeb36f8

Please sign in to comment.