Merge pull request #53219 from krzyzacy/node-logs

Automatic merge from submit-queue (batch tested with PRs 51021, 53225, 53094, 53219). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Let node test subcommand be an arg

Currently node-test will strip off the 1st arg if subcommand is not specified, i.e. both [Jenkins](https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/jenkins/e2e-node-jenkins.sh#L44) and [kubetest](https://github.com/kubernetes/test-infra/blob/master/kubetest/e2e.go#L524) -- make it a flag will be clearer.

/assign @Random-Liu @yguo0905
pull/6/head
Kubernetes Submit Queue 2017-09-29 12:38:25 -07:00 committed by GitHub
commit 8ca56cb696
2 changed files with 8 additions and 16 deletions

View File

@ -32,7 +32,7 @@ TIMEOUT=${TIMEOUT:-"45m"}
mkdir -p ${ARTIFACTS}
go run test/e2e_node/runner/remote/run_remote.go conformance \
go run test/e2e_node/runner/remote/run_remote.go --test-suite=conformance \
--logtostderr --vmodule=*=4 --ssh-env="gce" --ssh-user="$GCE_USER" \
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \

View File

@ -45,6 +45,7 @@ import (
)
var testArgs = flag.String("test_args", "", "Space-separated list of arguments to pass to Ginkgo test runner.")
var testSuite = flag.String("test-suite", "default", "Test suite the runner initializes with. Currently support default|conformance")
var instanceNamePrefix = flag.String("instance-name-prefix", "", "prefix for instance names")
var zone = flag.String("zone", "", "gce zone the hosts live in")
var project = flag.String("project", "", "gce project the hosts live in")
@ -143,27 +144,18 @@ type internalGCEImage struct {
tests []string
}
// parseFlags parse subcommands and flags
func parseFlags() {
if len(os.Args) <= 1 {
glog.Fatalf("Too few flags specified: %v", os.Args)
}
// Parse subcommand.
subcommand := os.Args[1]
switch subcommand {
func main() {
flag.Parse()
switch *testSuite {
case "conformance":
suite = remote.InitConformanceRemote()
// TODO: Add subcommand for node soaking, node conformance, cri validation.
default:
case "default":
// Use node e2e suite by default if no subcommand is specified.
suite = remote.InitNodeE2ERemote()
default:
glog.Fatalf("--test-suite must be one of default or conformance")
}
// Parse test flags.
flag.CommandLine.Parse(os.Args[2:])
}
func main() {
parseFlags()
rand.Seed(time.Now().UTC().UnixNano())
if *buildOnly {