mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-06-28 16:46:35 +00:00
1d89ea64e5
Signed-off-by: Qi Zheng <qi.zheng@intel.com>
1.4 KiB
1.4 KiB
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.