Skip to content

Commit

Permalink
fix: suite test using global cfg and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chinaran committed Apr 7, 2022
1 parent bb9cbb5 commit dff39ef
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ var _ = BeforeSuite(func() {
/*
Then, we start the envtest cluster.
*/
cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ var _ = BeforeSuite(func() {
ErrorIfCRDPathMissing: true,
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ var _ = BeforeSuite(func() {
},
}
cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v3-config/api/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v3-multigroup/apis/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v3-v1beta1/api/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v3/api/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ var _ = BeforeSuite(func() {
},
}

cfg, err := testEnv.Start()
var err error
// cfg is defined in this file globally.
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down

0 comments on commit dff39ef

Please sign in to comment.