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:
parent
b2dbce8e51
commit
269f81fa3d
|
|
@ -14,25 +14,16 @@ limitations under the License.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
_ "github.com/kubernetes-csi/csi-driver-nfs/test"
|
_ "github.com/kubernetes-csi/csi-driver-nfs/test"
|
||||||
. "github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func main() {
|
||||||
framework.HandleFlags()
|
framework.HandleFlags()
|
||||||
framework.AfterReadingAllFlags(&framework.TestContext)
|
framework.AfterReadingAllFlags(&framework.TestContext)
|
||||||
}
|
gomega.RegisterFailHandler(ginkgo.Fail)
|
||||||
|
ginkgo.RunSpecs(&testing.T{}, "CSI Suite")
|
||||||
func Test(t *testing.T) {
|
|
||||||
flag.Parse()
|
|
||||||
RegisterFailHandler(Fail)
|
|
||||||
RunSpecs(t, "CSI Suite")
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
Test(&testing.T{})
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue