-
Notifications
You must be signed in to change notification settings - Fork 1
/
placement_test.go
51 lines (39 loc) · 1.08 KB
/
placement_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Use and distribution licensed under the Apache license version 2.
//
// See the COPYING file in the root project directory for full text.
package kube_test
import (
"bufio"
"bytes"
"fmt"
"path/filepath"
"testing"
"github.com/gdt-dev/gdt"
gdtcontext "github.com/gdt-dev/gdt/context"
"github.com/stretchr/testify/require"
kindfix "github.com/gdt-dev/kube/fixtures/kind"
"github.com/gdt-dev/kube/testutil"
)
func TestPlacementSpread(t *testing.T) {
testutil.SkipIfNoKind(t)
require := require.New(t)
fp := filepath.Join("testdata", "placement-spread.yaml")
s, err := gdt.From(fp)
require.Nil(err)
require.NotNil(s)
kindCfgPath := filepath.Join("testdata", "kind-config-three-workers-three-zones.yaml")
var b bytes.Buffer
w := bufio.NewWriter(&b)
ctx := gdtcontext.New(gdtcontext.WithDebug(w))
ctx = gdtcontext.RegisterFixture(
ctx, "kind-three-workers-three-zones",
kindfix.New(
kindfix.WithClusterName("kind-three-workers-three-zones"),
kindfix.WithConfigPath(kindCfgPath),
),
)
err = s.Run(ctx, t)
require.Nil(err)
w.Flush()
fmt.Println(b.String())
}