diff options
Diffstat (limited to 'old/moon_pythonunittest')
-rw-r--r-- | old/moon_pythonunittest/Dockerfile | 8 | ||||
-rw-r--r-- | old/moon_pythonunittest/README.md | 8 | ||||
-rw-r--r-- | old/moon_pythonunittest/requirements.txt | 11 | ||||
-rw-r--r-- | old/moon_pythonunittest/run_tests.sh | 19 |
4 files changed, 46 insertions, 0 deletions
diff --git a/old/moon_pythonunittest/Dockerfile b/old/moon_pythonunittest/Dockerfile new file mode 100644 index 00000000..b8fb5151 --- /dev/null +++ b/old/moon_pythonunittest/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3 + +RUN pip install pytest requests_mock requests --upgrade +ADD requirements.txt /root +RUN pip install -r /root/requirements.txt --upgrade + +ADD run_tests.sh /root +CMD ["sh", "/root/run_tests.sh"]
\ No newline at end of file diff --git a/old/moon_pythonunittest/README.md b/old/moon_pythonunittest/README.md new file mode 100644 index 00000000..45d3a988 --- /dev/null +++ b/old/moon_pythonunittest/README.md @@ -0,0 +1,8 @@ +# Python Unit Test Docker + +## Build +- `docker image build -t wukongsun/moon_python_unit_test .` + +## Push to DockerHub +- `docker login --username=wukongsun` +- `docker image push wukongsun/moon_python_unit_test`
\ No newline at end of file diff --git a/old/moon_pythonunittest/requirements.txt b/old/moon_pythonunittest/requirements.txt new file mode 100644 index 00000000..fe107293 --- /dev/null +++ b/old/moon_pythonunittest/requirements.txt @@ -0,0 +1,11 @@ +kombu !=4.0.1,!=4.0.0 +oslo.messaging +oslo.config +oslo.log +vine +werkzeug +flask +requests +pytest +pytest-cov +requests_mock diff --git a/old/moon_pythonunittest/run_tests.sh b/old/moon_pythonunittest/run_tests.sh new file mode 100644 index 00000000..285bd856 --- /dev/null +++ b/old/moon_pythonunittest/run_tests.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +cd /data +pip3 install -r tests/unit_python/requirements.txt --upgrade +pip3 install . + +if [ -d /data/dist ]; +then + pip install /data/dist/*.tar.gz --upgrade + pip install /data/dist/*.whl --upgrade +fi + +if [ -f /data/tests/unit_python/run_tests.sh ]; +then + bash /data/tests/unit_python/run_tests.sh; +fi + +cd /data/tests/unit_python +pytest --cov --cov-report term --cov-report html --cov-report xml . |