Move testhelper package to pkg so it can be installed as dependency in secrets injector repo

This commit is contained in:
Volodymyr Zotov
2025-08-21 15:22:41 -05:00
parent 22a7c8f586
commit ca051a08cf
7 changed files with 27 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ import (
//nolint:staticcheck // ST1001
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/test/testhelper/system"
"github.com/1Password/onepassword-operator/pkg/testhelper/system"
)
// LoadImageToKind loads a local docker image to the Kind cluster

View File

@@ -11,8 +11,8 @@ import (
//nolint:staticcheck // ST1001
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/test/testhelper/defaults"
"github.com/1Password/onepassword-operator/test/testhelper/system"
"github.com/1Password/onepassword-operator/pkg/testhelper/defaults"
"github.com/1Password/onepassword-operator/pkg/testhelper/system"
)
func CreateSecretFromEnvVar(envVar, secretName string) {

View File

@@ -8,7 +8,7 @@ import (
//nolint:staticcheck // ST1001
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/test/testhelper/system"
"github.com/1Password/onepassword-operator/pkg/testhelper/system"
)
func BuildOperatorImage() {

View File

@@ -12,3 +12,22 @@ func TestE2E(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "onepassword-operator e2e suite")
}
//By("create onepassword-token secret")
//connectToken, _ := os.LookupEnv("OP_CONNECT_TOKEN")
//Expect(connectToken).NotTo(BeEmpty())
//output := exec.Command("kubectl", "-n", namespace, "create", "secret", "generic", "onepassword-token", "--from-literal=token="+connectToken)
//_, err = utils.Run(output)
//ExpectWithOffset(1, err).NotTo(HaveOccurred())
//It("Secret is updated after POOLING_INTERVAL", func() {
// // TODO: implement
//})
//
//It("Secret with `ignore-secret` annotation is not updated", func() {
// // TODO: implement
//})
//
//It("Deployment not auto restarts when ", func() {
// // TODO: implement
//})

View File

@@ -6,10 +6,10 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/test/testhelper/kind"
"github.com/1Password/onepassword-operator/test/testhelper/kube"
"github.com/1Password/onepassword-operator/test/testhelper/operator"
"github.com/1Password/onepassword-operator/test/testhelper/system"
"github.com/1Password/onepassword-operator/pkg/testhelper/kind"
"github.com/1Password/onepassword-operator/pkg/testhelper/kube"
"github.com/1Password/onepassword-operator/pkg/testhelper/operator"
"github.com/1Password/onepassword-operator/pkg/testhelper/system"
)
const (