Skip to content

Commit

Permalink
Remove setup-node, which is not needed after we run the whole test as
Browse files Browse the repository at this point in the history
root.
  • Loading branch information
Random-Liu committed Dec 6, 2016
1 parent 2c61d2f commit 7c2b1f4
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 33 deletions.
2 changes: 1 addition & 1 deletion hack/make-rules/test-e2e-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if [ $remote = true ] ; then
--zone="$zone" --project="$project" --gubernator="$gubernator" \
--hosts="$hosts" --images="$images" --cleanup="$cleanup" \
--results-dir="$artifacts" --ginkgo-flags="$ginkgoflags" \
--image-project="$image_project" --instance-name-prefix="$instance_prefix" --setup-node="true" \
--image-project="$image_project" --instance-name-prefix="$instance_prefix" \
--delete-instances="$delete_instances" --test_args="$test_args" --instance-metadata="$metadata" \
2>&1 | tee -i "${artifacts}/build-log.txt"
exit $?
Expand Down
1 change: 0 additions & 1 deletion hack/verify-flags/known-flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ service-node-ports
service-overrides
service-sync-period
session-affinity
setup-node
show-all
show-events
show-kind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]"'
SETUP_NODE=false
TEST_ARGS='--feature-gates=DynamicKubeletConfig=true'
KUBELET_ARGS='--experimental-cgroups-per-qos=true --cgroup-root=/'
PARALLELISM=1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]"'
SETUP_NODE=false
TEST_ARGS='--feature-gates=DynamicKubeletConfig=true,StreamingProxyRedirects=true'
KUBELET_ARGS='--experimental-cri=true'
PARALLELISM=1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-pr-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]|\[Slow\]|\[Serial\]" --flakeAttempts=2'
SETUP_NODE=false
TEST_ARGS='--feature-gates=StreamingProxyRedirects=true'
KUBELET_ARGS='--experimental-cri=true'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--focus="\[Serial\]" --skip="\[Flaky\]|\[Benchmark\]"'
SETUP_NODE=false
TEST_ARGS='--feature-gates=DynamicKubeletConfig=true,StreamingProxyRedirects=true'
KUBELET_ARGS='--experimental-cri=true'
PARALLELISM=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]|\[Serial\]"'
SETUP_NODE=false
TEST_ARGS='--feature-gates=StreamingProxyRedirects=true'
KUBELET_ARGS='--experimental-cri=true'
TIMEOUT=1h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]"'
SETUP_NODE=true
PARALLELISM=1
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ GCE_PROJECT=k8s-jkns-ci-node-e2e
GCE_INSTANCE_METADATA="user-data<${GCI_CLOUD_INIT},gci-docker-version=${DOCKER_VERSION}"
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]|\[Serial\]"'
SETUP_NODE=true
TIMEOUT=1h
2 changes: 1 addition & 1 deletion test/e2e_node/jenkins/e2e-node-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ go run test/e2e_node/runner/remote/run_remote.go --logtostderr --vmodule=*=4 --
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
--image-config-file="$GCE_IMAGE_CONFIG_PATH" --cleanup="$CLEANUP" \
--results-dir="$ARTIFACTS" --ginkgo-flags="--nodes=$PARALLELISM $GINKGO_FLAGS" \
--test-timeout="$TIMEOUT" --setup-node="$SETUP_NODE" --test_args="$TEST_ARGS --kubelet-flags=\"$KUBELET_ARGS\"" \
--test-timeout="$TIMEOUT" --test_args="$TEST_ARGS --kubelet-flags=\"$KUBELET_ARGS\"" \
--instance-metadata="$GCE_INSTANCE_METADATA"
1 change: 0 additions & 1 deletion test/e2e_node/jenkins/jenkins-ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]|\[Serial\]"'
SETUP_NODE=false
KUBELET_ARGS='--experimental-cgroups-per-qos=true --cgroup-root=/'
TIMEOUT=1h
1 change: 0 additions & 1 deletion test/e2e_node/jenkins/jenkins-flaky.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--focus="\[Flaky\]"'
SETUP_NODE=false
KUBELET_ARGS='--experimental-cgroups-per-qos=true --cgroup-root=/'
1 change: 0 additions & 1 deletion test/e2e_node/jenkins/jenkins-pull.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-pr-node-e2e
CLEANUP=true
GINKGO_FLAGS='--skip="\[Flaky\]|\[Slow\]|\[Serial\]" --flakeAttempts=2'
SETUP_NODE=false
KUBELET_ARGS='--experimental-cgroups-per-qos=true --cgroup-root=/'

1 change: 0 additions & 1 deletion test/e2e_node/jenkins/jenkins-serial.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=k8s-jkns-ci-node-e2e
CLEANUP=true
GINKGO_FLAGS='--focus="\[Serial\]" --skip="\[Flaky\]|\[Benchmark\]"'
SETUP_NODE=false
TEST_ARGS='--feature-gates=DynamicKubeletConfig=true'
KUBELET_ARGS='--experimental-cgroups-per-qos=true --cgroup-root=/'
PARALLELISM=1
Expand Down
2 changes: 0 additions & 2 deletions test/e2e_node/jenkins/template.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ GCE_PROJECT=
GCE_IMAGE_PROJECT=
# If true, delete instances created from GCE_IMAGES/GCE_IMAGE_CONFIG_PATH and files copied to GCE_HOSTS
CLEANUP=true
# If true, current user will be added to the docker group on test node
SETUP_NODE=false
# KUBELET_ARGS are the arguments passed to kubelet. The args will override corresponding default kubelet
# setting in the test framework and --kubelet-flags in TEST_ARGS.
# If true QoS Cgroup Hierarchy is created and tests specifc to the cgroup hierarchy run
Expand Down
13 changes: 1 addition & 12 deletions test/e2e_node/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,7 @@ func CreateTestArchive() (string, error) {
}

// Returns the command output, whether the exit was ok, and any errors
func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string, setupNode bool, testArgs string, ginkgoFlags string) (string, bool, error) {
if setupNode {
uname, err := user.Current()
if err != nil {
return "", false, fmt.Errorf("could not find username: %v", err)
}
output, err := SSH(host, "usermod", "-a", "-G", "docker", uname.Username)
if err != nil {
return "", false, fmt.Errorf("instance %s not running docker daemon - Command failed: %s", host, output)
}
}

func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string, testArgs string, ginkgoFlags string) (string, bool, error) {
// Create the temp staging directory
glog.Infof("Staging test binaries on %s", host)
workspace := fmt.Sprintf("/tmp/node-e2e-%s", getTimestamp())
Expand Down
9 changes: 4 additions & 5 deletions test/e2e_node/runner/remote/run_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ var hosts = flag.String("hosts", "", "hosts to test")
var cleanup = flag.Bool("cleanup", true, "If true remove files from remote hosts and delete temporary instances")
var deleteInstances = flag.Bool("delete-instances", true, "If true, delete any instances created")
var buildOnly = flag.Bool("build-only", false, "If true, build e2e_node_test.tar.gz and exit.")
var setupNode = flag.Bool("setup-node", false, "When true, current user will be added to docker group on the test machine")
var instanceMetadata = flag.String("instance-metadata", "", "key/value metadata for instances separated by '=' or '<', 'k=v' means the key is 'k' and the value is 'v'; 'k<p' means the key is 'k' and the value is extracted from the local path 'p', e.g. k1=v1,k2<p2")
var gubernator = flag.Bool("gubernator", false, "If true, output Gubernator link to view logs")
var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify additional flags such as --skip=.")
Expand Down Expand Up @@ -248,7 +247,7 @@ func main() {
fmt.Printf("Initializing e2e tests using host %s.\n", host)
running++
go func(host string, junitFilePrefix string) {
results <- testHost(host, *cleanup, junitFilePrefix, *setupNode, *ginkgoFlags)
results <- testHost(host, *cleanup, junitFilePrefix, *ginkgoFlags)
}(host, host)
}
}
Expand Down Expand Up @@ -334,7 +333,7 @@ func getImageMetadata(input string) *compute.Metadata {
}

// Run tests in archive against host
func testHost(host string, deleteFiles bool, junitFilePrefix string, setupNode bool, ginkgoFlagsStr string) *TestResult {
func testHost(host string, deleteFiles bool, junitFilePrefix string, ginkgoFlagsStr string) *TestResult {
instance, err := computeService.Instances.Get(*project, *zone, host).Do()
if err != nil {
return &TestResult{
Expand Down Expand Up @@ -364,7 +363,7 @@ func testHost(host string, deleteFiles bool, junitFilePrefix string, setupNode b
}
}

output, exitOk, err := remote.RunRemote(path, host, deleteFiles, junitFilePrefix, setupNode, *testArgs, ginkgoFlagsStr)
output, exitOk, err := remote.RunRemote(path, host, deleteFiles, junitFilePrefix, *testArgs, ginkgoFlagsStr)
return &TestResult{
output: output,
err: err,
Expand Down Expand Up @@ -450,7 +449,7 @@ func testImage(imageConfig *internalGCEImage, junitFilePrefix string) *TestResul
// If we are going to delete the instance, don't bother with cleaning up the files
deleteFiles := !*deleteInstances && *cleanup

result := testHost(host, deleteFiles, junitFilePrefix, *setupNode, ginkgoFlagsStr)
result := testHost(host, deleteFiles, junitFilePrefix, ginkgoFlagsStr)
// This is a temporary solution to collect serial node serial log. Only port 1 contains useful information.
// TODO(random-liu): Extract out and unify log collection logic with cluste e2e.
serialPortOutput, err := computeService.Instances.GetSerialPortOutput(*project, *zone, host).Port(1).Do()
Expand Down

0 comments on commit 7c2b1f4

Please sign in to comment.