aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/templates
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/templates')
-rw-r--r--moonv4/templates/python_unit_test/Dockerfile8
-rw-r--r--moonv4/templates/python_unit_test/README.md8
-rw-r--r--moonv4/templates/python_unit_test/requirements.txt10
-rw-r--r--moonv4/templates/python_unit_test/run_tests.sh7
4 files changed, 33 insertions, 0 deletions
diff --git a/moonv4/templates/python_unit_test/Dockerfile b/moonv4/templates/python_unit_test/Dockerfile
new file mode 100644
index 00000000..b8fb5151
--- /dev/null
+++ b/moonv4/templates/python_unit_test/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/moonv4/templates/python_unit_test/README.md b/moonv4/templates/python_unit_test/README.md
new file mode 100644
index 00000000..45d3a988
--- /dev/null
+++ b/moonv4/templates/python_unit_test/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/moonv4/templates/python_unit_test/requirements.txt b/moonv4/templates/python_unit_test/requirements.txt
new file mode 100644
index 00000000..b611b008
--- /dev/null
+++ b/moonv4/templates/python_unit_test/requirements.txt
@@ -0,0 +1,10 @@
+kombu !=4.0.1,!=4.0.0
+oslo.messaging
+oslo.config
+oslo.log
+vine
+werkzeug
+flask
+requests
+pytest
+requests_mock \ No newline at end of file
diff --git a/moonv4/templates/python_unit_test/run_tests.sh b/moonv4/templates/python_unit_test/run_tests.sh
new file mode 100644
index 00000000..68b75efa
--- /dev/null
+++ b/moonv4/templates/python_unit_test/run_tests.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+cd /data
+pip3 install .
+
+cd /data/tests/unit_python
+pytest .