Skip to content

Commit

Permalink
enable sidecarset e2e parallelism feature
Browse files Browse the repository at this point in the history
Signed-off-by: Abner-1 <[email protected]>
  • Loading branch information
ABNER-1 committed Feb 6, 2025
1 parent 1552292 commit 33a57ab
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/e2e-1.30.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] (PullImage|ContainerRecreateRequest|PullImages|PodProbeMarker)' --print-info --disable-parallel
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] (PullImage|ContainerRecreateRequest|PullImages)' --print-info --disable-parallel
advanced-daemonset:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] SidecarSet' --print-info --disable-parallel
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] SidecarSet' --print-info
ephemeraljob:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
tools/hack/run-kruise-e2e-test.sh --focus '\[policy\] PodUnavailableBudget' --print-info --disable-parallel
tools/hack/run-kruise-e2e-test.sh --focus '\[policy\] PodUnavailableBudget' --print-info
clonesetAndInplace:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] (InplaceVPA)' --print-info
tools/hack/run-kruise-e2e-test.sh --focus '\[apps\] (CloneSet|InplaceVPA)' --print-info
other:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -295,4 +295,4 @@ jobs:
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
tools/hack/run-kruise-e2e-test.sh --focus "" --skip '\[apps\] (InplaceVPA|AppStatefulSetStorage|StatefulSet|PullImage|PullImages|ContainerRecreateRequest|DaemonSet|SidecarSet|EphemeralJob|PodProbeMarker)' --skip '\[policy\] PodUnavailableBudget' --timeout 90m --print-info
tools/hack/run-kruise-e2e-test.sh --focus "" --skip '\[apps\] (CloneSet|InplaceVPA|AppStatefulSetStorage|StatefulSet|PullImage|PullImages|ContainerRecreateRequest|DaemonSet|SidecarSet|EphemeralJob)' --skip '\[policy\] PodUnavailableBudget' --timeout 90m --print-info
12 changes: 12 additions & 0 deletions test/e2e/apps/podprobemarker.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ var _ = SIGDescribe("PodProbeMarker", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
for _, npp := range nppList.Items {
for _, podProbe := range npp.Spec.PodProbes {
if podProbe.Namespace != ns {
continue
}
gomega.Expect(validPods.Has(podProbe.UID)).To(gomega.BeTrue())
}
}
Expand Down Expand Up @@ -265,6 +268,9 @@ var _ = SIGDescribe("PodProbeMarker", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
for _, npp := range nppList.Items {
for _, podProbe := range npp.Spec.PodProbes {
if podProbe.Namespace != ns {
continue
}
gomega.Expect(validPods.Has(podProbe.UID)).To(gomega.BeTrue())
}
}
Expand Down Expand Up @@ -531,6 +537,9 @@ var _ = SIGDescribe("PodProbeMarker", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
for _, npp := range nppList.Items {
for _, podProbe := range npp.Spec.PodProbes {
if podProbe.Namespace != ns {
continue
}
gomega.Expect(validPods.Has(podProbe.UID)).To(gomega.BeTrue())
}
}
Expand Down Expand Up @@ -560,6 +569,9 @@ var _ = SIGDescribe("PodProbeMarker", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
for _, npp := range nppList.Items {
for _, podProbe := range npp.Spec.PodProbes {
if podProbe.Namespace != ns {
continue
}
gomega.Expect(validPods.Has(podProbe.UID)).To(gomega.BeTrue())
}
}
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/apps/sidecarset.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import (
"strconv"
"time"

v1core "k8s.io/client-go/kubernetes/typed/core/v1"

appsv1alpha1 "github.com/openkruise/kruise/apis/apps/v1alpha1"
kruiseclientset "github.com/openkruise/kruise/pkg/client/clientset/versioned"
"github.com/openkruise/kruise/pkg/control/sidecarcontrol"
"github.com/openkruise/kruise/pkg/util"
"github.com/openkruise/kruise/pkg/util/configuration"
"github.com/openkruise/kruise/test/e2e/framework"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"

"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
Expand All @@ -47,6 +48,7 @@ import (
)

var _ = SIGDescribe("SidecarSet", func() {
framework.TestContext.DeleteNamespaceOnFailure = false
f := framework.NewDefaultFramework("sidecarset")
var ns string
var c clientset.Interface
Expand All @@ -66,7 +68,7 @@ var _ = SIGDescribe("SidecarSet", func() {
framework.DumpDebugInfo(c, ns)
}
framework.Logf("Deleting all SidecarSet in cluster")
tester.DeleteSidecarSets()
tester.DeleteSidecarSets(ns)
tester.DeleteDeployments(ns)
})
framework.ConformanceIt("pods don't have matched sidecarSet", func() {
Expand Down Expand Up @@ -652,14 +654,14 @@ var _ = SIGDescribe("SidecarSet", func() {
})*/
})

framework.KruiseDescribe("SidecarSet Upgrade functionality [SidecarSeUpgrade]", func() {
framework.KruiseDescribe("SidecarSet Upgrade functionality [SidecarSetUpgrade]", func() {

ginkgo.AfterEach(func() {
if ginkgo.CurrentGinkgoTestDescription().Failed {
framework.DumpDebugInfo(c, ns)
}
framework.Logf("Deleting all SidecarSet in cluster")
tester.DeleteSidecarSets()
tester.DeleteSidecarSets(ns)
tester.DeleteDeployments(ns)
})

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/apps/sidecarset_hotupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var _ = SIGDescribe("SidecarSet", func() {
framework.DumpDebugInfo(c, ns)
}
framework.Logf("Deleting all SidecarSet in cluster")
tester.DeleteSidecarSets()
tester.DeleteSidecarSets(ns)
tester.DeleteDeployments(ns)
})

Expand Down
12 changes: 9 additions & 3 deletions test/e2e/framework/sidecarset_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ package framework

import (
"context"
"fmt"
"time"

"k8s.io/utils/ptr"

appsv1alpha1 "github.com/openkruise/kruise/apis/apps/v1alpha1"
kruiseclientset "github.com/openkruise/kruise/pkg/client/clientset/versioned"
"github.com/openkruise/kruise/pkg/control/sidecarcontrol"
"github.com/openkruise/kruise/pkg/util"
webhookutil "github.com/openkruise/kruise/pkg/webhook/util"
"k8s.io/utils/ptr"

"github.com/onsi/gomega"
apps "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -58,7 +60,8 @@ func (s *SidecarSetTester) NewBaseSidecarSet(ns string) *appsv1alpha1.SidecarSet
APIVersion: "apps.kruise.io/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "test-sidecarset",

Name: fmt.Sprintf("test-sidecarset-%s", ns),
Labels: map[string]string{
"app": "sidecar",
},
Expand Down Expand Up @@ -226,14 +229,17 @@ func (s *SidecarSetTester) CreateDeployment(deployment *apps.Deployment) {
s.WaitForDeploymentRunning(deployment)
}

func (s *SidecarSetTester) DeleteSidecarSets() {
func (s *SidecarSetTester) DeleteSidecarSets(ns string) {
sidecarSetList, err := s.kc.AppsV1alpha1().SidecarSets().List(context.TODO(), metav1.ListOptions{})
if err != nil {
Logf("List sidecarSets failed: %s", err.Error())
return
}

for _, sidecarSet := range sidecarSetList.Items {
if sidecarSet.Namespace != ns {
continue
}
s.DeleteSidecarSet(&sidecarSet)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/policy/podunavailablebudget.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = SIGDescribe("PodUnavailableBudget", func() {
tester.DeletePubs(ns)
tester.DeleteDeployments(ns)
tester.DeleteCloneSets(ns)
sidecarTester.DeleteSidecarSets()
sidecarTester.DeleteSidecarSets(ns)
})

ginkgo.It("PodUnavailableBudget selector no matched pods", func() {
Expand Down

0 comments on commit 33a57ab

Please sign in to comment.