Skip to content

Commit

Permalink
[YUNIKORN-2330] [e2e] Ensure all e2e test suites upload test artifacts (
Browse files Browse the repository at this point in the history
apache#766)

Closes: apache#766

Signed-off-by: Craig Condit <[email protected]>
  • Loading branch information
pbacsko authored and craigcondit committed Jan 17, 2024
1 parent 57f11dc commit 3c78e59
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion test/e2e/configmap/configmap_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package configmap

import (
"path/filepath"
"runtime"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -32,6 +33,8 @@ import (
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/yunikorn"
)

var suiteName string

func init() {
configmanager.YuniKornTestConfig.ParseFlags()
}
Expand All @@ -57,7 +60,8 @@ var (
)

var _ = BeforeSuite(func() {

_, filename, _, _ := runtime.Caller(0)
suiteName = common.GetSuiteName(filename)
kClient = k8s.KubeCtl{}
Ω(kClient.SetClient()).To(BeNil())

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/configmap/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
v1 "k8s.io/api/core/v1"

"github.com/apache/yunikorn-core/pkg/common/configs"
tests "github.com/apache/yunikorn-k8shim/test/e2e"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/configmanager"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/k8s"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/yunikorn"
Expand Down Expand Up @@ -100,6 +101,7 @@ var _ = Describe("ConfigMap", func() {
})

AfterEach(func() {
tests.DumpClusterInfoIfSpecFailed(suiteName, []string{"default"})
yunikorn.RestoreConfigMapWrapper(oldConfigMap, "")
})
})
Expand Down
12 changes: 7 additions & 5 deletions test/e2e/persistent_volume/persistent_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@ import (
"runtime"
"time"

"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"

"k8s.io/apimachinery/pkg/api/resource"

appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
storagev1 "k8s.io/api/storage/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/onsi/ginkgo/v2"

tests "github.com/apache/yunikorn-k8shim/test/e2e"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/common"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/k8s"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/yunikorn"
Expand Down Expand Up @@ -181,6 +179,10 @@ var _ = ginkgo.Describe("PersistentVolume", func() {
deleteNfsRelatedRoles(saName, crName, crbName)
deleteNfsProvisioner(serverName, scName)
})

ginkgo.AfterEach(func() {
tests.DumpClusterInfoIfSpecFailed(suiteName, []string{"default"})
})
})

func createNfsRbac(svaName string, crName string, crbName string) {
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/recovery_and_restart/recovery_and_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"

tests "github.com/apache/yunikorn-k8shim/test/e2e"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/configmanager"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/common"
"github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/k8s"
Expand Down Expand Up @@ -364,6 +365,10 @@ var _ = ginkgo.Describe("", func() {
err = kClient.WaitForJobPodsSucceeded(dev, job.Name, 1, 60*time.Second)
Ω(err).NotTo(gomega.HaveOccurred())
})

ginkgo.AfterEach(func() {
tests.DumpClusterInfoIfSpecFailed(suiteName, []string{dev})
})
})

func getSchedulerPodTolerations(includeMaster bool) []v1.Toleration {
Expand Down

0 comments on commit 3c78e59

Please sign in to comment.