fix e2e test

This commit is contained in:
cvvz 2025-03-17 11:18:39 +08:00
parent 61dc677205
commit 94198d39af

View File

@ -109,8 +109,6 @@ var _ = ginkgo.BeforeSuite(func() {
kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config") kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config")
os.Setenv(kubeconfigEnvVar, kubeconfig) os.Setenv(kubeconfigEnvVar, kubeconfig)
} }
handleFlags()
framework.AfterReadingAllFlags(&framework.TestContext)
options := nfs.DriverOptions{ options := nfs.DriverOptions{
NodeID: nodeID, NodeID: nodeID,
@ -215,6 +213,12 @@ func execTestCmd(cmds []testCmd) {
} }
} }
func TestMain(m *testing.M) {
handleFlags()
framework.AfterReadingAllFlags(&framework.TestContext)
os.Exit(m.Run())
}
func TestE2E(t *testing.T) { func TestE2E(t *testing.T) {
gomega.RegisterFailHandler(ginkgo.Fail) gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, "E2E Suite") ginkgo.RunSpecs(t, "E2E Suite")