tests: simplify the test binary

With a single function the control flow is more obvious. Avoiding dot
imports makes it clearer where the functions come from.
This commit is contained in:
Patrick Ohly 2019-06-13 12:39:08 +02:00
parent b2dbce8e51
commit 269f81fa3d
1 changed files with 5 additions and 14 deletions

View File

@ -14,25 +14,16 @@ limitations under the License.
package main
import (
"flag"
_ "github.com/kubernetes-csi/csi-driver-nfs/test"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"k8s.io/kubernetes/test/e2e/framework"
"testing"
)
func init() {
func main() {
framework.HandleFlags()
framework.AfterReadingAllFlags(&framework.TestContext)
}
func Test(t *testing.T) {
flag.Parse()
RegisterFailHandler(Fail)
RunSpecs(t, "CSI Suite")
}
func main() {
Test(&testing.T{})
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(&testing.T{}, "CSI Suite")
}