suite_test.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. package generator
  13. import (
  14. "testing"
  15. // nolint
  16. . "github.com/onsi/ginkgo/v2"
  17. // nolint
  18. . "github.com/onsi/gomega"
  19. "github.com/external-secrets/external-secrets-e2e/framework/addon"
  20. "github.com/external-secrets/external-secrets-e2e/framework/util"
  21. )
  22. var _ = SynchronizedBeforeSuite(func() []byte {
  23. cfg := &addon.Config{}
  24. cfg.KubeConfig, cfg.KubeClientSet, cfg.CRClient = util.NewConfig()
  25. By("installing eso")
  26. addon.InstallGlobalAddon(addon.NewESO(addon.WithCRDs()), cfg)
  27. return nil
  28. }, func([]byte) {
  29. // noop
  30. })
  31. var _ = SynchronizedAfterSuite(func() {
  32. // noop
  33. }, func() {
  34. By("Cleaning up global addons")
  35. addon.UninstallGlobalAddons()
  36. if CurrentSpecReport().Failed() {
  37. addon.PrintLogs()
  38. }
  39. })
  40. func TestE2E(t *testing.T) {
  41. NewWithT(t)
  42. RegisterFailHandler(Fail)
  43. RunSpecs(t, "external-secrets generator e2e suite", Label("generator"))
  44. }