mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #26571 from pwittrock/node-e2e-godeps
Automatic merge from submit-queue Node e2e use vendored testing packages. []()
This commit is contained in:
commit
6c5f5c5e36
@ -63,30 +63,40 @@ and remote passwordless sudo access over ssh)
|
|||||||
* using [run_e2e.go](../../test/e2e_node/runner/run_e2e.go) to build a tar.gz
|
* using [run_e2e.go](../../test/e2e_node/runner/run_e2e.go) to build a tar.gz
|
||||||
and executing on host (requires host access w/ remote sudo)
|
and executing on host (requires host access w/ remote sudo)
|
||||||
|
|
||||||
### Configuring a new remote host for testing
|
### Option 1: Configuring a new remote host from scratch for testing
|
||||||
|
|
||||||
The host must contain a environment capable of supporting a mini-kubernetes
|
The host must contain an environment capable of running a minimal kubernetes cluster
|
||||||
cluster. Includes:
|
consisting of etcd, the kube-apiserver, and kubelet. The steps required to step a host vary between distributions
|
||||||
|
(coreos, rhel, ubuntu, etc), but may include:
|
||||||
* install etcd
|
* install etcd
|
||||||
* install docker
|
* install docker
|
||||||
|
* add user running tests to docker group
|
||||||
* install lxc and update grub commandline
|
* install lxc and update grub commandline
|
||||||
* enable tty-less sudo access
|
* enable tty-less sudo access
|
||||||
|
|
||||||
See [setup_host.sh](../../test/e2e_node/environment/setup_host.sh)
|
These steps should be captured in [setup_host.sh](../../test/e2e_node/environment/setup_host.sh)
|
||||||
|
|
||||||
|
### Option 2: Copying an existing host image from another project
|
||||||
|
|
||||||
|
If there is an existing image in another project you would like to use, you can use the script
|
||||||
|
[copy-e2e-image.sh](../../test/e2e_node/jenkins/copy-e2e-image.sh) to copy an image
|
||||||
|
from one GCE project to another.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
copy-e2e-image.sh <image-to-be-copied-name> <from-gce-project> <to-gce-project>
|
||||||
|
```
|
||||||
|
|
||||||
### Running the tests
|
### Running the tests
|
||||||
|
|
||||||
1. If running against a host on gce
|
1. If running tests against a running host on gce
|
||||||
|
|
||||||
|
* Make sure host names are resolvable to ssh by running `gcloud compute config-ssh` to
|
||||||
|
update ~/.ssh/config with the GCE hosts. After running this command, check the hostnames
|
||||||
|
in the ~/.ssh/config file and verify you have the correct access by running `ssh <host>`.
|
||||||
|
|
||||||
* Copy [template.properties](../../test/e2e_node/jenkins/template.properties)
|
* Copy [template.properties](../../test/e2e_node/jenkins/template.properties)
|
||||||
|
|
||||||
* Fill in `GCE_HOSTS`
|
* Fill in `GCE_HOSTS` with the name of the host
|
||||||
* Set `INSTALL_GODEP=true` to install `godep`, `gomega`, `ginkgo`
|
|
||||||
|
|
||||||
* Make sure host names are resolvable to ssh `ssh <host>`.
|
|
||||||
|
|
||||||
* If needed, you can run `gcloud compute config-ssh` to add gce hostnames to
|
|
||||||
your .ssh/config so they are resolvable by ssh.
|
|
||||||
|
|
||||||
* Run `test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
|
* Run `test/e2e_node/jenkins/e2e-node-jenkins.sh <path to properties file>`
|
||||||
* **Must be run from kubernetes root**
|
* **Must be run from kubernetes root**
|
||||||
@ -103,8 +113,6 @@ tests with `--ssh-options`
|
|||||||
separated hosts>`
|
separated hosts>`
|
||||||
|
|
||||||
* **Must be run from kubernetes root**
|
* **Must be run from kubernetes root**
|
||||||
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`,
|
|
||||||
`github.com/onsi/ginkgo/ginkgo`
|
|
||||||
|
|
||||||
3. Alternatively, manually build and copy `e2e_node_test.tar.gz` to a remote
|
3. Alternatively, manually build and copy `e2e_node_test.tar.gz` to a remote
|
||||||
host
|
host
|
||||||
@ -112,9 +120,6 @@ host
|
|||||||
* Build the tar.gz `go run test/e2e_node/runner/run_e2e.go --logtostderr
|
* Build the tar.gz `go run test/e2e_node/runner/run_e2e.go --logtostderr
|
||||||
--build-only`
|
--build-only`
|
||||||
|
|
||||||
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`,
|
|
||||||
`github.com/onsi/ginkgo/ginkgo`
|
|
||||||
|
|
||||||
* Copy `e2e_node_test.tar.gz` to the remote host
|
* Copy `e2e_node_test.tar.gz` to the remote host
|
||||||
|
|
||||||
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
|
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
|
||||||
@ -127,13 +132,15 @@ kube-apiserver binaries.
|
|||||||
|
|
||||||
## Running tests against a gce image
|
## Running tests against a gce image
|
||||||
|
|
||||||
* Build a gce image from a prepared gce host
|
* Option 1: Build a gce image from a prepared gce host
|
||||||
* Create the host from a base image and configure it (see above)
|
* Create the host from a base image and configure it (see above)
|
||||||
* Run tests against this remote host to ensure that it is setup correctly
|
* Run tests against this remote host to ensure that it is setup correctly
|
||||||
before doing anything else
|
before doing anything else
|
||||||
* Create a gce *snapshot* of the instance
|
* Create a gce *snapshot* of the instance
|
||||||
* Create a gce *disk* from the snapshot
|
* Create a gce *disk* from the snapshot
|
||||||
* Create a gce *image* from the disk
|
* Create a gce *image* from the disk
|
||||||
|
* Option 2: Copy a prepared image from another project
|
||||||
|
* Instructions above
|
||||||
* Test that the necessary gcloud credentials are setup for the project
|
* Test that the necessary gcloud credentials are setup for the project
|
||||||
* `gcloud compute --project <project> --zone <zone> images list`
|
* `gcloud compute --project <project> --zone <zone> images list`
|
||||||
* Verify that your image appears in the list
|
* Verify that your image appears in the list
|
||||||
@ -146,9 +153,7 @@ before doing anything else
|
|||||||
|
|
||||||
Node e2e tests are run against a static list of host environments continuously
|
Node e2e tests are run against a static list of host environments continuously
|
||||||
or when manually triggered on a github.com pull requests using the trigger
|
or when manually triggered on a github.com pull requests using the trigger
|
||||||
phrase `@k8s-bot test node e2e experimental` - *results not yet publish, pending
|
phrase `@k8s-bot test node e2e`
|
||||||
evaluation of test stability.*.
|
|
||||||
|
|
||||||
|
|
||||||
### CI Host environments
|
### CI Host environments
|
||||||
|
|
||||||
@ -159,14 +164,12 @@ TBD
|
|||||||
| linux distro | distro version | docker version | etcd version | cloud provider |
|
| linux distro | distro version | docker version | etcd version | cloud provider |
|
||||||
|-----------------|----------------|----------------|--------------|----------------|
|
|-----------------|----------------|----------------|--------------|----------------|
|
||||||
| containervm | | 1.8 | | gce |
|
| containervm | | 1.8 | | gce |
|
||||||
| rhel | 7 | 1.10 | | gce |
|
|
||||||
| centos | 7 | 1.10 | | gce |
|
|
||||||
| coreos | stable | 1.8 | | gce |
|
| coreos | stable | 1.8 | | gce |
|
||||||
| debian | jessie | 1.10 | | gce |
|
| debian | jessie | 1.10 | | gce |
|
||||||
| ubuntu | trusty | 1.8 | | gce |
|
| ubuntu | trusty | 1.8 | | gce |
|
||||||
| ubuntu | trusty | 1.9 | | gce |
|
| ubuntu | trusty | 1.9 | | gce |
|
||||||
| ubuntu | trusty | 1.10 | | gce |
|
| ubuntu | trusty | 1.10 | | gce |
|
||||||
| ubuntu | wily | 1.10 | | gce |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,30 +57,17 @@ func CreateTestArchive() string {
|
|||||||
// Build the executables
|
// Build the executables
|
||||||
buildGo()
|
buildGo()
|
||||||
|
|
||||||
// Build the e2e tests into an executable
|
|
||||||
glog.Infof("Building ginkgo k8s test binaries...")
|
|
||||||
testDir, err := getK8sNodeTestDir()
|
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Failed to locate test/e2e_node directory %v.", err)
|
|
||||||
}
|
|
||||||
cmd := exec.Command("ginkgo", "build", testDir)
|
|
||||||
cmd.Stdout = os.Stdout
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
err = cmd.Run()
|
|
||||||
if err != nil {
|
|
||||||
glog.Fatalf("Failed to build e2e tests under %s %v\n", testDir, err)
|
|
||||||
}
|
|
||||||
ginkgoTest := filepath.Join(testDir, "e2e_node.test")
|
|
||||||
if _, err := os.Stat(ginkgoTest); err != nil {
|
|
||||||
glog.Fatalf("Failed to locate test binary %s", ginkgoTest)
|
|
||||||
}
|
|
||||||
defer os.Remove(ginkgoTest)
|
|
||||||
|
|
||||||
// Make sure we can find the newly built binaries
|
// Make sure we can find the newly built binaries
|
||||||
buildOutputDir, err := getK8sBuildOutputDir()
|
buildOutputDir, err := getK8sBuildOutputDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Failed to locate kubernetes build output directory %v", err)
|
glog.Fatalf("Failed to locate kubernetes build output directory %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ginkgoTest := filepath.Join(buildOutputDir, "e2e_node.test")
|
||||||
|
if _, err := os.Stat(ginkgoTest); err != nil {
|
||||||
|
glog.Fatalf("Failed to locate test binary %s", ginkgoTest)
|
||||||
|
}
|
||||||
|
|
||||||
kubelet := filepath.Join(buildOutputDir, "kubelet")
|
kubelet := filepath.Join(buildOutputDir, "kubelet")
|
||||||
if _, err := os.Stat(kubelet); err != nil {
|
if _, err := os.Stat(kubelet); err != nil {
|
||||||
glog.Fatalf("Failed to locate binary %s", kubelet)
|
glog.Fatalf("Failed to locate binary %s", kubelet)
|
||||||
|
@ -28,12 +28,6 @@ set -x
|
|||||||
|
|
||||||
. $1
|
. $1
|
||||||
|
|
||||||
if [ "$INSTALL_GODEP" = true ] ; then
|
|
||||||
go get -u github.com/tools/godep
|
|
||||||
go get -u github.com/onsi/ginkgo/ginkgo
|
|
||||||
go get -u github.com/onsi/gomega
|
|
||||||
fi
|
|
||||||
|
|
||||||
go build test/e2e_node/environment/conformance.go
|
go build test/e2e_node/environment/conformance.go
|
||||||
ARTIFACTS=${WORKSPACE}/_artifacts
|
ARTIFACTS=${WORKSPACE}/_artifacts
|
||||||
mkdir -p ${ARTIFACTS}
|
mkdir -p ${ARTIFACTS}
|
||||||
|
@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
|
|||||||
GCE_ZONE=us-central1-f
|
GCE_ZONE=us-central1-f
|
||||||
GCE_PROJECT=kubernetes-jenkins
|
GCE_PROJECT=kubernetes-jenkins
|
||||||
GCE_IMAGE_PROJECT=kubernetes-jenkins
|
GCE_IMAGE_PROJECT=kubernetes-jenkins
|
||||||
INSTALL_GODEP=true
|
|
||||||
CLEANUP=true
|
CLEANUP=true
|
||||||
GINKGO_FLAGS=
|
GINKGO_FLAGS=
|
||||||
SETUP_NODE=false
|
SETUP_NODE=false
|
||||||
|
@ -7,7 +7,6 @@ GCE_IMAGES=e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-
|
|||||||
GCE_ZONE=us-central1-f
|
GCE_ZONE=us-central1-f
|
||||||
GCE_PROJECT=kubernetes-jenkins-pull
|
GCE_PROJECT=kubernetes-jenkins-pull
|
||||||
GCE_IMAGE_PROJECT=kubernetes-jenkins-pull
|
GCE_IMAGE_PROJECT=kubernetes-jenkins-pull
|
||||||
INSTALL_GODEP=true
|
|
||||||
CLEANUP=true
|
CLEANUP=true
|
||||||
GINKGO_FLAGS=
|
GINKGO_FLAGS=
|
||||||
SETUP_NODE=false
|
SETUP_NODE=false
|
@ -11,8 +11,6 @@ GCE_PROJECT=
|
|||||||
# Gce project to use for GCE_IMAGES
|
# Gce project to use for GCE_IMAGES
|
||||||
# required when using GCE_IMAGES
|
# required when using GCE_IMAGES
|
||||||
GCE_IMAGE_PROJECT=
|
GCE_IMAGE_PROJECT=
|
||||||
# If true, assume a pristine GOPATH and install necessary godeps
|
|
||||||
INSTALL_GODEP=false
|
|
||||||
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
|
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
|
||||||
CLEANUP=true
|
CLEANUP=true
|
||||||
# If true, current user will be added to the docker group on test node
|
# If true, current user will be added to the docker group on test node
|
||||||
|
Loading…
Reference in New Issue
Block a user