Add CONTRIBUTING.md for travis tests

Signed-off-by: Qi Zheng <qi.zheng@intel.com>
This commit is contained in:
Qi Zheng
2019-08-04 20:54:48 -07:00
committed by qzheng527
parent 728cafb488
commit 1d89ea64e5
+50
View File
@@ -0,0 +1,50 @@
Contributing Guidelines
=======================
Principle of the test cases
----------------------------
Focusing on basic tests on docker environment, may covering below:
* Quick and light, not performance test
* Check the basic functionality
* Check the ports exported
* Check the parameters passed could be recognized
* Check the ownership permission if necessary
* No dependencies for each test cases
One note of the "no dependencies" means it is suggested to keep the
container lifecycle within each test case. This could be done through
either of the way:
* Start the container, do something, stop/close the container in each
test case.
* use BAT "setup" and "teardown" hooks.
How to add test cases
------------------------------------
The test cases are for the micro services already added in the travis CI.
So for any micro services defined in the "env" part of the ".travis" file,
the same name directory could be added in the directory "tests". And the
same name BAT script in the new added directory will be executed for each
PR/commits. For example, redis.
* First, the redis is added in the "env".
```
services:
- docker
env:
......
- DOCKERFILE_DIR=redis
......
```
* Second, create the "redis" directory and BAT script under tests
```
dockerfiles
└── tests
└── redis
└── redis.bats
```
* Last, develop the redis BAT test cases in "redis.bats" following the above
principles.