Skip to content

Commit

Permalink
fix(lint): changes test pkg name
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak committed Oct 5, 2023
1 parent 311eb36 commit 5632608
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions controllers/dscinitialization/dscinitialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
dsci "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtest_util"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtestutil"
operatorv1 "github.com/openshift/api/operator/v1"
corev1 "k8s.io/api/core/v1"
netv1 "k8s.io/api/networking/v1"
Expand All @@ -27,7 +27,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
var applicationName string
BeforeEach(func() {
// when
applicationName = envtest_util.AppendRandomNameTo("default-test")
applicationName = envtestutil.AppendRandomNameTo("default-test")
desiredDsci := createDSCI(applicationName)
Expect(k8sClient.Create(context.Background(), desiredDsci)).Should(Succeed())
foundDsci := &dsci.DSCInitialization{}
Expand Down Expand Up @@ -96,7 +96,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
AfterEach(cleanupResources)

It("Should not update rolebinding if it exists", func() {
applicationName := envtest_util.AppendRandomNameTo("rolebinding-test")
applicationName := envtestutil.AppendRandomNameTo("rolebinding-test")

// given
desiredRoleBinding := &authv1.RoleBinding{
Expand Down Expand Up @@ -133,7 +133,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
})

It("Should not update configmap if it exists", func() {
applicationName := envtest_util.AppendRandomNameTo("configmap-test")
applicationName := envtestutil.AppendRandomNameTo("configmap-test")

// given
desiredConfigMap := &corev1.ConfigMap{
Expand Down Expand Up @@ -166,7 +166,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
})

It("Should not update namespace if it exists", func() {
applicationName := envtest_util.AppendRandomNameTo("configmap-test")
applicationName := envtestutil.AppendRandomNameTo("configmap-test")
anotherNamespace := "test-another-ns"

// given
Expand Down
4 changes: 2 additions & 2 deletions controllers/dscinitialization/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package dscinitialization_test

import (
"context"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtest_util"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtestutil"
"k8s.io/apimachinery/pkg/runtime"
"path/filepath"
"testing"
Expand Down Expand Up @@ -76,7 +76,7 @@ var _ = BeforeSuite(func() {
ctx, cancel = context.WithCancel(context.TODO())
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
By("bootstrapping test environment")
rootPath, pathErr := envtest_util.FindProjectRoot()
rootPath, pathErr := envtestutil.FindProjectRoot()
Expect(pathErr).ToNot(HaveOccurred(), pathErr)

testEnv = &envtest.Environment{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package envtest_util
package envtestutil

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package envtest_util
package envtestutil

import (
"crypto/rand"
Expand Down
2 changes: 1 addition & 1 deletion tests/envtest_util/utils.go → tests/envtestutil/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package envtest_util
package envtestutil

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
. "github.com/onsi/gomega"
dscv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/servicemesh/feature"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtest_util"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtestutil"
"io"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -32,16 +32,16 @@ var _ = Describe("preconditions", func() {
Context("namespace existence", func() {

var (
objectCleaner *envtest_util.Cleaner
objectCleaner *envtestutil.Cleaner
testFeature *feature.Feature
namespace string
)

BeforeEach(func() {
objectCleaner = envtest_util.CreateCleaner(envTestClient, envTest.Config, timeout, interval)
objectCleaner = envtestutil.CreateCleaner(envTestClient, envTest.Config, timeout, interval)

testFeatureName := "test-ns-creation"
namespace = envtest_util.AppendRandomNameTo(testFeatureName)
namespace = envtestutil.AppendRandomNameTo(testFeatureName)

dsciSpec := newDSCInitializationSpec(namespace)
var err error
Expand Down Expand Up @@ -135,7 +135,7 @@ var _ = Describe("preconditions", func() {
var _ = Describe("Ensuring service mesh is set up correctly", func() {

var (
objectCleaner *envtest_util.Cleaner
objectCleaner *envtestutil.Cleaner
dsciSpec *dscv1.DSCInitializationSpec
serviceMeshSpec *dscv1.ServiceMeshSpec
serviceMeshCheck *feature.Feature
Expand All @@ -158,7 +158,7 @@ var _ = Describe("Ensuring service mesh is set up correctly", func() {

Expect(err).ToNot(HaveOccurred())

objectCleaner = envtest_util.CreateCleaner(envTestClient, envTest.Config, timeout, interval)
objectCleaner = envtestutil.CreateCleaner(envTestClient, envTest.Config, timeout, interval)
})

It("should find installed Service Mesh Control Plane", func() {
Expand All @@ -184,13 +184,13 @@ var _ = Describe("Ensuring service mesh is set up correctly", func() {
var _ = Describe("Data Science Project Migration", func() {

var (
objectCleaner *envtest_util.Cleaner
objectCleaner *envtestutil.Cleaner
dsciSpec *dscv1.DSCInitializationSpec
migrationFeature *feature.Feature
)

BeforeEach(func() {
objectCleaner = envtest_util.CreateCleaner(envTestClient, envTest.Config, timeout, interval)
objectCleaner = envtestutil.CreateCleaner(envTestClient, envTest.Config, timeout, interval)

dsciSpec = newDSCInitializationSpec("default")

Expand Down Expand Up @@ -268,15 +268,15 @@ var _ = Describe("Cleanup operations", func() {
Context("configuring control plane for auth(z)", func() {

var (
objectCleaner *envtest_util.Cleaner
objectCleaner *envtestutil.Cleaner
dsciSpec *dscv1.DSCInitializationSpec
serviceMeshSpec *dscv1.ServiceMeshSpec
namespace = "test"
name = "minimal"
)

BeforeEach(func() {
objectCleaner = envtest_util.CreateCleaner(envTestClient, envTest.Config, timeout, interval)
objectCleaner = envtestutil.CreateCleaner(envTestClient, envTest.Config, timeout, interval)

dsciSpec = newDSCInitializationSpec(namespace)

Expand Down Expand Up @@ -500,10 +500,10 @@ func getNamespace(namespace string) (*v1.Namespace, error) {
}

func fromTestTmpDir(fileName string) string {
root, err := envtest_util.FindProjectRoot()
root, err := envtestutil.FindProjectRoot()
Expect(err).ToNot(HaveOccurred())

tmpDir := filepath.Join(os.TempDir(), envtest_util.RandomUUIDName(16))
tmpDir := filepath.Join(os.TempDir(), envtestutil.RandomUUIDName(16))
if err := os.Mkdir(tmpDir, os.ModePerm); err != nil {
Fail(err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/servicemesh/service_mesh_suite_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package servicemesh_test
import (
"context"
"fmt"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtest_util"
"github.com/opendatahub-io/opendatahub-operator/v2/tests/envtestutil"
v1 "k8s.io/api/core/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"math/rand"
Expand Down Expand Up @@ -44,7 +44,7 @@ var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseFlagOptions(&opts)))

By("Bootstrapping k8s test environment")
projectDir, err := envtest_util.FindProjectRoot()
projectDir, err := envtestutil.FindProjectRoot()
if err != nil {
fmt.Printf("Error finding project root: %v\n", err)
return
Expand Down

0 comments on commit 5632608

Please sign in to comment.