Skip to content

Commit ad83321

Browse files
authored
Merge pull request #1077 from elezar/rework-device-plugin-tests
[no-relnotes] Only install device plugin once
2 parents 028a130 + 772f98a commit ad83321

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/e2e/device-plugin_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ var _ = NVDescribe("GPU Device Plugin", func() {
9494
// Create clients for apiextensions and our CRD api
9595
extClient = extclient.NewForConfigOrDie(f.ClientConfig())
9696
helmReleaseName = "nvdp-e2e-test" + rand.String(5)
97-
})
9897

99-
JustBeforeEach(func(ctx context.Context) {
100-
// reset Helm Client
10198
chartSpec = helm.ChartSpec{
10299
ReleaseName: helmReleaseName,
103100
ChartName: *HelmChart,
@@ -113,6 +110,9 @@ var _ = NVDescribe("GPU Device Plugin", func() {
113110
Expect(err).NotTo(HaveOccurred())
114111
})
115112

113+
JustBeforeEach(func(ctx context.Context) {
114+
})
115+
116116
AfterEach(func(ctx context.Context) {
117117
// Run diagnostic collector if test failed
118118
if CurrentSpecReport().Failed() {
@@ -128,17 +128,19 @@ var _ = NVDescribe("GPU Device Plugin", func() {
128128
err = diagnosticsCollector.Collect(ctx)
129129
Expect(err).NotTo(HaveOccurred())
130130
}
131-
// Cleanup before next test run
131+
})
132+
133+
AfterAll(func(ctx context.Context) {
132134
// Delete Helm release
133135
err := f.HelmClient.UninstallReleaseByName(helmReleaseName)
134136
Expect(err).NotTo(HaveOccurred())
135-
})
136137

137-
AfterAll(func(ctx context.Context) {
138138
for _, crd := range crds {
139139
err := extClient.ApiextensionsV1().CustomResourceDefinitions().Delete(ctx, crd.Name, metav1.DeleteOptions{})
140140
Expect(err).NotTo(HaveOccurred())
141141
}
142+
143+
// TODO: Add a check for a zero node capacity.
142144
})
143145

144146
Context("and NV Driver is installed", func() {

0 commit comments

Comments
 (0)