Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aim for namespace uniqueness across parallel integration tests specs #7680

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions integration/utilities/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
package kube

import (
"fmt"

harness "github.com/dlespiau/kube-test-harness"
"github.com/dlespiau/kube-test-harness/logger"
"github.com/google/uuid"
"github.com/onsi/ginkgo/v2"
)

type tHelper struct{ ginkgo.FullGinkgoTInterface }

func (t *tHelper) Helper() {}
func (t *tHelper) Name() string { return "eksctl-test" }
func (t *tHelper) Name() string { return "eksctl" }

// NewTest creates a new test harness to more easily run integration tests against the provided Kubernetes cluster.
func NewTest(kubeconfigPath string) (*harness.Test, error) {
Expand All @@ -28,7 +27,9 @@ func NewTest(kubeconfigPath string) (*harness.Test, error) {
return nil, err
}
test := h.NewTest(t)
test.Namespace += fmt.Sprintf("-%d", t.ParallelProcess())
// several parallel test specs may initialize a new harness and close it after completion,
// thus, we aim to minimize the chance of conflicting actions against same K8s namespace
test.Namespace += uuid.NewString()
test.Setup()
return test, nil
}