Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
fix test initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n committed Jan 19, 2024
1 parent ae0fed6 commit d20c791
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cp_mod_migration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (

func TestCproxy(t *testing.T) {
RegisterFailHandler(Fail)
defer GinkgoRecover()

Expect(loadCMs(&cms)).ShouldNot(HaveOccurred(), "unable to load test data")
if err := loadCMs(&cms); err != nil {
t.Fatal(err)
}
mockedClient = newClient(t, cms)

RunSpecs(t, "Cproxy Suite")
Expand Down
4 changes: 4 additions & 0 deletions cp_mod_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ var _ = Describe("cp-mod-migrator", Ordered, func() {
var cr v294.ConnectivityProxy
err := extract.GetCPConfiguration(ctx, &cr, mockedClient)
Expect(err).ShouldNot(HaveOccurred())

err = extract.SetDefaults(ctx, &cr, mockedClient)
Expect(err).ShouldNot(HaveOccurred())

Expect(k8sClient.Create(ctx, &cr)).ShouldNot(HaveOccurred())
deleteObjs(ctx, &cr)
}
Expand Down
2 changes: 1 addition & 1 deletion cp_mod_migration_utilz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func cp(name, namespace string) v294.ConnectivityProxy {
}

func loadCMs(data *[]corev1.ConfigMap) error {
file, err := os.Open("../../hack/testdata/configmaps.yaml")
file, err := os.Open("./hack/testdata/configmaps.yaml")
if err != nil {
return err
}
Expand Down

0 comments on commit d20c791

Please sign in to comment.