Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coordinator e2e V00003 #3157

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require (
github.com/sasha-s/go-deadlock v0.3.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spidernet-io/e2eframework v0.0.0-20240127082814-64fbda07e655
github.com/spidernet-io/e2eframework v0.0.0-20240130031916-71bf7b1ddd00
github.com/tigera/operator v1.32.4
github.com/vishvananda/netlink v1.2.1-beta.2.0.20230621221334-77712cff8739
go.opentelemetry.io/otel v1.21.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
github.com/spidernet-io/e2eframework v0.0.0-20240127082814-64fbda07e655 h1:l0ZpCKTS/rj1RF0TnbtJBOMyKRt7iurvn7tHm3RUBQM=
github.com/spidernet-io/e2eframework v0.0.0-20240127082814-64fbda07e655/go.mod h1:k0KYxyNjZYyEG1bsGzSbMx5Q+Z1H6oOjEq5qz9UlBzY=
github.com/spidernet-io/e2eframework v0.0.0-20240130031916-71bf7b1ddd00 h1:e6+I4kKloty0a6bV9y1s8lF+Xb3AX+yUdj53J9EsfJw=
github.com/spidernet-io/e2eframework v0.0.0-20240130031916-71bf7b1ddd00/go.mod h1:k0KYxyNjZYyEG1bsGzSbMx5Q+Z1H6oOjEq5qz9UlBzY=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand Down
31 changes: 9 additions & 22 deletions test/e2e/spidercoordinator/spidercoordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import (
"context"
"fmt"
"reflect"
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1alpha1"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/spidernet-io/spiderpool/pkg/constant"
"github.com/spidernet-io/spiderpool/pkg/coordinatormanager"
"github.com/spidernet-io/spiderpool/pkg/ip"
spiderpoolv2beta1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v2beta1"
"github.com/spidernet-io/spiderpool/test/e2e/common"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1alpha1"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
)

var _ = Describe("SpiderCoordinator", Label("spidercoordinator", "overlay"), Serial, func() {
Expand Down Expand Up @@ -257,28 +257,15 @@ var _ = Describe("SpiderCoordinator", Label("spidercoordinator", "overlay"), Ser
deployObject.Spec.Template.Annotations = annotations
ctx, cancel := context.WithTimeout(context.Background(), common.PodStartTimeout)
defer cancel()

podList, err := common.CreateDeployUntilExpectedReplicas(frame, deployObject, ctx)
Expect(err).NotTo(HaveOccurred())
ctx, cancel = context.WithTimeout(context.Background(), common.EventOccurTimeout)
defer cancel()

eventCtx, cancel := context.WithTimeout(context.Background(), common.EventOccurTimeout)
defer cancel()
errLog := "spidercoordinator: default no ready"
for _, pod := range podList.Items {
events, err := frame.GetEvents(ctx, common.OwnerPod, pod.Name, pod.Namespace)
Expect(err).To(Succeed(), "Failed to get pod events: %v", err)

found := false
for _, event := range events.Items {
if strings.Contains(event.Message, errLog) {
found = true
break
}
}

if !found {
return false
}
err = frame.WaitExceptEventOccurred(eventCtx, common.OwnerPod, pod.Name, pod.Namespace, errLog)
Expect(err).NotTo(HaveOccurred())
}

return true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ github.com/spf13/viper/internal/encoding/javaproperties
github.com/spf13/viper/internal/encoding/json
github.com/spf13/viper/internal/encoding/toml
github.com/spf13/viper/internal/encoding/yaml
# github.com/spidernet-io/e2eframework v0.0.0-20240127082814-64fbda07e655
# github.com/spidernet-io/e2eframework v0.0.0-20240130031916-71bf7b1ddd00
## explicit; go 1.21
github.com/spidernet-io/e2eframework/framework
github.com/spidernet-io/e2eframework/tools
Expand Down
Loading