aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuan HE <ruan.he@orange.com>2017-12-01 15:44:28 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-12-01 15:44:28 +0000
commit60f88d9bbadc96ff434071cab070933f41220e21 (patch)
treecbbb1f87bc3064f19645b1396be7a78a207c73c3
parent7a8c6828a170d001e905a108b7f873497cdefa88 (diff)
parentc47f1f819cd81efa3c7f9bc64cda30d337730210 (diff)
Merge "create moon python unit test docker image"
-rw-r--r--moonv4/moon_utilities/README.md11
-rw-r--r--moonv4/moon_utilities/tests/README.md12
-rw-r--r--moonv4/templates/python_unit_test/Dockerfile (renamed from moonv4/moon_utilities/tests/unit_python/Dockerfile)3
-rw-r--r--moonv4/templates/python_unit_test/README.md8
-rw-r--r--moonv4/templates/python_unit_test/requirements.txt (renamed from moonv4/moon_utilities/tests/unit_python/requirements.txt)0
-rw-r--r--moonv4/templates/python_unit_test/run_tests.sh (renamed from moonv4/moon_utilities/tests/unit_python/run_tests.sh)1
6 files changed, 21 insertions, 14 deletions
diff --git a/moonv4/moon_utilities/README.md b/moonv4/moon_utilities/README.md
index b658a864..f5fa43ca 100644
--- a/moonv4/moon_utilities/README.md
+++ b/moonv4/moon_utilities/README.md
@@ -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
index ddb4f55d..00000000
--- a/moonv4/moon_utilities/tests/README.md
+++ /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
-
-
-
-
diff --git a/moonv4/moon_utilities/tests/unit_python/Dockerfile b/moonv4/templates/python_unit_test/Dockerfile
index 681edcd7..b8fb5151 100644
--- a/moonv4/moon_utilities/tests/unit_python/Dockerfile
+++ b/moonv4/templates/python_unit_test/Dockerfile
@@ -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
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/moon_utilities/tests/unit_python/requirements.txt b/moonv4/templates/python_unit_test/requirements.txt
index b611b008..b611b008 100644
--- a/moonv4/moon_utilities/tests/unit_python/requirements.txt
+++ b/moonv4/templates/python_unit_test/requirements.txt
diff --git a/moonv4/moon_utilities/tests/unit_python/run_tests.sh b/moonv4/templates/python_unit_test/run_tests.sh
index 527e3dc4..68b75efa 100644
--- a/moonv4/moon_utilities/tests/unit_python/run_tests.sh
+++ b/moonv4/templates/python_unit_test/run_tests.sh
@@ -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