Merge pull request #280 from Random-Liu/update-testing-doc

Update testing doc
This commit is contained in:
Lantao Liu 2017-09-25 11:07:28 -07:00 committed by GitHub
commit b1b925d7e4

View File

@ -2,10 +2,9 @@ CRI-Containerd Testing Guide
============================ ============================
This document assumes you have already setup the development environment (go, git, `cri-containerd` repo etc.). This document assumes you have already setup the development environment (go, git, `cri-containerd` repo etc.).
Before sending pull requests you should at least make sure your changes have passed code verification, unit and CRI validation tests. Before sending pull requests you should at least make sure your changes have passed code verification, unit, integration and CRI validation tests.
## Code Verification ## Code Verification
Code verification includes lint, code formatting, boilerplate check etc. Code verification includes lint, code formatting, boilerplate check etc.
* Install tools used by code verification: * Install tools used by code verification:
```shell ```shell
make install.tools make install.tools
@ -16,9 +15,16 @@ make verify
``` ```
## Unit Test ## Unit Test
Run all unit tests in `cri-containerd` repo. Run all unit tests in `cri-containerd` repo.
``` ```shell
make test make test
``` ```
## Integration Test
Run all integration tests in `cri-containerd` repo.
* [Install dependencies](../README.md#install-dependencies).
* Run integration test:
```shell
make test-integration
```
## CRI Validation Test ## CRI Validation Test
[CRI validation test](https://github.com/kubernetes/community/blob/master/contributors/devel/cri-validation.md) is a test framework for validating that a Container Runtime Interface (CRI) implementation such as `cri-containerd` meets all the requirements necessary to manage pod sandboxes, containers, images etc. [CRI validation test](https://github.com/kubernetes/community/blob/master/contributors/devel/cri-validation.md) is a test framework for validating that a Container Runtime Interface (CRI) implementation such as `cri-containerd` meets all the requirements necessary to manage pod sandboxes, containers, images etc.
@ -39,28 +45,14 @@ make test-cri FOCUS=REGEXP_TO_FOCUS SKIP=REGEXP_TO_SKIP
[More information](https://github.com/kubernetes-incubator/cri-tools) about CRI validation test. [More information](https://github.com/kubernetes-incubator/cri-tools) about CRI validation test.
## Node E2E Test ## Node E2E Test
[Node e2e test](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-node-tests.md) is a test framework testing Kubernetes node level functionalities such as managing pods, mounting volumes etc. It starts a local cluster with Kubelet and a few other minimum dependencies, and runs node functionality tests against the local cluster. [Node e2e test](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-node-tests.md) is a test framework testing Kubernetes node level functionalities such as managing pods, mounting volumes etc. It starts a local cluster with Kubelet and a few other minimum dependencies, and runs node functionality tests against the local cluster.
* Setup Kubernetes development environment following [Kubernetes Development Guide](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md).
* [Install dependencies](../README.md#install-dependencies). * [Install dependencies](../README.md#install-dependencies).
* Build and install `cri-containerd`: * Run node e2e test:
```shell ```shell
make make test-e2e-node
sudo make install
``` ```
* Start `containerd` in 1st terminal: * Focus or skip specific node e2e test:
```shell ```shell
sudo containerd make test-e2e-node FOCUS=REGEXP_TO_FOCUS SKIP=REGEXP_TO_SKIP
```
* Start `cri-containerd` in 2nd terminal:
```shell
sudo cri-containerd -v 2 --alsologtostderr
``` ```
* Run node e2e test **from Kubernetes project directory** in 3rd terminal:
```shell
make test-e2e-node RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT=/var/run/cri-containerd.sock
```
*Note that `cri-containerd` is still in alpha, it can only pass part of node e2e tests now.*
<!-- TODO: Get rid of this after all node e2e tests pass. -->
[More information](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-node-tests.md) about Kubernetes node e2e test. [More information](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-node-tests.md) about Kubernetes node e2e test.
<!-- TODO: Add cluster e2e test --> <!-- TODO: Add cluster e2e test -->