mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #105206 from pohly/test-integration-help
test/integration: skip etcd startup for -help flag
This commit is contained in:
commit
86d23cf441
@ -18,6 +18,7 @@ package framework
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
@ -168,6 +169,9 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
|
|||||||
|
|
||||||
// EtcdMain starts an etcd instance before running tests.
|
// EtcdMain starts an etcd instance before running tests.
|
||||||
func EtcdMain(tests func() int) {
|
func EtcdMain(tests func() int) {
|
||||||
|
// Bail out early when -help was given as parameter.
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
stop, err := startEtcd()
|
stop, err := startEtcd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Fatalf("cannot run integration tests: unable to start etcd: %v", err)
|
klog.Fatalf("cannot run integration tests: unable to start etcd: %v", err)
|
||||||
|
@ -17,13 +17,11 @@ limitations under the License.
|
|||||||
package benchmark
|
package benchmark
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/integration/framework"
|
"k8s.io/kubernetes/test/integration/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
flag.Parse()
|
|
||||||
framework.EtcdMain(m.Run)
|
framework.EtcdMain(m.Run)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user