create moon python unit test docker image 09/48209/1
authorRHE <rebirthmonkey@gmail.com>
Fri, 1 Dec 2017 15:42:57 +0000 (16:42 +0100)
committerRHE <rebirthmonkey@gmail.com>
Fri, 1 Dec 2017 15:42:57 +0000 (16:42 +0100)
Change-Id: I91c7103ca046a67c3cefadbd9ca6eca52cfbc0cf
Signed-off-by: RHE <rebirthmonkey@gmail.com>
moonv4/moon_utilities/README.md
moonv4/moon_utilities/tests/README.md [deleted file]
moonv4/templates/python_unit_test/Dockerfile [moved from moonv4/moon_utilities/tests/unit_python/Dockerfile with 73% similarity]
moonv4/templates/python_unit_test/README.md [new file with mode: 0644]
moonv4/templates/python_unit_test/requirements.txt [moved from moonv4/moon_utilities/tests/unit_python/requirements.txt with 100% similarity]
moonv4/templates/python_unit_test/run_tests.sh [moved from moonv4/moon_utilities/tests/unit_python/run_tests.sh with 57% similarity]

index b658a86..f5fa43c 100644 (file)
@@ -8,5 +8,16 @@ For any other information, refer to the parent project:
 
 moon_utilities is a common Python lib for other Moon Python packages
 
+## Build
+### Build Python Package
+- `cd moon_utilities`
+- `python3 setup.py sdist bdist_wheel`
 
+### Push Python Package to PIP
+
+## Test
+### Python Unit Test
+- launch Docker for Python unit tests
+    - `cd moon_utilities`
+    - `docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest`
 
diff --git a/moonv4/moon_utilities/tests/README.md b/moonv4/moon_utilities/tests/README.md
deleted file mode 100644 (file)
index ddb4f55..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# Tests
-
-## Python Unit Test for moon_utilities
-- build the moon_utilities package
-- launch Docker for Python unit tests
-    - `cd moon_utilities`
-    - `docker run --volume $(pwd):/data moon_utilities_test`
-- upload moon_utilities to PIP
-
-
-
-
@@ -4,4 +4,5 @@ RUN pip install pytest requests_mock requests --upgrade
 ADD requirements.txt /root
 RUN pip install -r /root/requirements.txt --upgrade
 
-CMD ["sh", "/data/tests/unit_python/run_tests.sh"]
\ No newline at end of file
+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 (file)
index 0000000..45d3a98
--- /dev/null
@@ -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
@@ -1,7 +1,6 @@
 #!/usr/bin/env bash
 
 cd /data
-pip3 install -r tests/unit_python/requirements.txt --upgrade
 pip3 install .
 
 cd /data/tests/unit_python