Skip to content

Commit

Permalink
test: rewrote async integration test for ginkgo@2
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
  • Loading branch information
ckotzbauer committed Apr 7, 2021
1 parent dc4fb15 commit a6a7791
Show file tree
Hide file tree
Showing 2 changed files with 244 additions and 200 deletions.
42 changes: 23 additions & 19 deletions e2e/integration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ func TestIntegration(t *testing.T) {
var clientset *kubernetes.Clientset
var client dynamic.Interface

var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter)))

kubeconfig := os.Getenv("KUBECONFIG")
cwd, _ := os.Getwd()
cfg, err := clientcmd.BuildConfigFromFlags("", filepath.Join(cwd, kubeconfig))
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

client, err = dynamic.NewForConfig(cfg)
Expect(err).NotTo(HaveOccurred())
Expect(client).NotTo(BeNil())

clientset, err = kubernetes.NewForConfig(cfg)
Expect(err).NotTo(HaveOccurred())
Expect(clientset).NotTo(BeNil())

close(done)
}, 60)
var _ = BeforeSuite(func() {
done := make(chan interface{})
go func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter)))

kubeconfig := os.Getenv("KUBECONFIG")
cwd, _ := os.Getwd()
cfg, err := clientcmd.BuildConfigFromFlags("", filepath.Join(cwd, kubeconfig))
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

client, err = dynamic.NewForConfig(cfg)
Expect(err).NotTo(HaveOccurred())
Expect(client).NotTo(BeNil())

clientset, err = kubernetes.NewForConfig(cfg)
Expect(err).NotTo(HaveOccurred())
Expect(clientset).NotTo(BeNil())

close(done)
}()
Eventually(done, 60).Should(BeClosed())
})
Loading

0 comments on commit a6a7791

Please sign in to comment.