@@ -17,16 +17,12 @@ limitations under the License.
17
17
package main
18
18
19
19
import (
20
- "bytes"
21
20
"context"
22
- "os"
23
21
"testing"
24
- "time"
25
22
26
- "github.com/deckhouse/deckhouse/pkg/log"
27
23
"github.com/deckhouse/module-sdk/pkg"
28
24
"github.com/deckhouse/module-sdk/testing/mock"
29
- . "github.com/onsi/ginkgo"
25
+ . "github.com/onsi/ginkgo/v2 "
30
26
. "github.com/onsi/gomega"
31
27
)
32
28
@@ -36,37 +32,19 @@ func TestDiscoveryVirthandlerNodes(t *testing.T) {
36
32
}
37
33
38
34
var _ = Describe ("Discovery virt-handler nodes" , func () {
39
- err := os .Setenv ("D8_IS_TESTS_ENVIRONMENT" , "true" )
40
- Expect (err ).ShouldNot (HaveOccurred ())
41
-
42
35
var (
43
- snapshots * mock.SnapshotsMock
44
- values * mock.PatchableValuesCollectorMock
45
- patchCollector * mock.PatchCollectorMock
46
- input * pkg.HookInput
47
- buf * bytes.Buffer
36
+ snapshots * mock.SnapshotsMock
37
+ values * mock.PatchableValuesCollectorMock
38
+ input * pkg.HookInput
48
39
)
49
40
50
41
BeforeEach (func () {
51
42
snapshots = mock .NewSnapshotsMock (GinkgoT ())
52
43
values = mock .NewPatchableValuesCollectorMock (GinkgoT ())
53
- patchCollector = mock .NewPatchCollectorMock (GinkgoT ())
54
-
55
- buf = bytes .NewBuffer ([]byte {})
56
44
57
45
input = & pkg.HookInput {
58
46
Values : values ,
59
47
Snapshots : snapshots ,
60
- Logger : log .NewLogger (log.Options {
61
- Level : log .LevelDebug .Level (),
62
- Output : buf ,
63
- TimeFunc : func (_ time.Time ) time.Time {
64
- parsedTime , err := time .Parse (time .DateTime , "2006-01-02 15:04:05" )
65
- Expect (err ).ShouldNot (HaveOccurred ())
66
- return parsedTime
67
- },
68
- }),
69
- PatchCollector : patchCollector ,
70
48
}
71
49
})
72
50
@@ -76,7 +54,7 @@ var _ = Describe("Discovery virt-handler nodes", func() {
76
54
[]pkg.Snapshot {},
77
55
)
78
56
values .SetMock .When (virtHandlerNodeCountPath , 0 )
79
- err := handleDiscoveryVirtHandkerNodes (context .Background (), input )
57
+ err := handleDiscoveryVirtHandlerNodes (context .Background (), input )
80
58
Expect (err ).ShouldNot (HaveOccurred ())
81
59
})
82
60
})
@@ -92,7 +70,7 @@ var _ = Describe("Discovery virt-handler nodes", func() {
92
70
)
93
71
94
72
values .SetMock .When (virtHandlerNodeCountPath , 2 )
95
- err := handleDiscoveryVirtHandkerNodes (context .Background (), input )
73
+ err := handleDiscoveryVirtHandlerNodes (context .Background (), input )
96
74
Expect (err ).ShouldNot (HaveOccurred ())
97
75
})
98
76
})
0 commit comments