From 0dd886f5fe35a9dc19f01fbeac00f975b7bf5b95 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 23 Jun 2017 03:52:16 -0400 Subject: [PATCH] Add new targets to help test packages. Signed-off-by: Roberto Rosario --- Makefile | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cabdbcd49b..b1b0105558 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ help: @echo "release_test_via_docker_alpine - Package (sdist and wheel) and upload to the PyPI test server using an Alpine Docker builder." @echo "release_via_docker_ubuntu - Package (sdist and wheel) and upload to PyPI using an Ubuntu Docker builder." @echo "release_via_docker_alpine - Package (sdist and wheel) and upload to PyPI using an Alpine Docker builder." + @echo "test_sdist_via_docker_ubuntu - Make an sdist packange and test it using an Ubuntu Docker container." + @echo "test_wheel_via_docker_ubuntu - Make a wheel package and test it using an Ubuntu Docker container." @echo "runserver - Run the development server." @echo "runserver_plus - Run the Django extension's development server." @@ -119,10 +121,10 @@ wheel: clean sdist ls -l dist release_test_via_docker_ubuntu: - docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip -y && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make test_release" + docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip -y && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make test_release" release_via_docker_ubuntu: - docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip -y && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make release" + docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip -y && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make release" release_test_via_docker_alpine: docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source alpine /bin/busybox sh -c "cp -r /host_source/* . && apk update && apk add python2 py2-pip make && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make test_release" @@ -130,6 +132,34 @@ release_test_via_docker_alpine: release_via_docker_alpine: docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source alpine /bin/busybox sh -c "cp -r /host_source/* . && apk update && apk add python2 py2-pip make && pip install -r requirements/build.txt && cp -r /host_home/.pypirc ~/.pypirc && make release" +test_sdist_via_docker_ubuntu: + docker run --rm --name mayan_sdist_test -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip libreoffice tesseract-ocr tesseract-ocr-deu poppler-utils -y && pip install -r requirements/development.txt && make sdist_test_suit" + +test_wheel_via_docker_ubuntu: + docker run --rm --name mayan_wheel_test -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "cp -r /host_source/* . && apt-get update && apt-get install make python-pip libreoffice tesseract-ocr tesseract-ocr-deu poppler-utils -y && pip install -r requirements/development.txt && make wheel_test_suit" + +sdist_test_suit: sdist + rm -f -R _virtualenv + virtualenv _virtualenv + sh -c '\ + . _virtualenv/bin/activate; \ + pip install `ls dist/*.gz`; \ + _virtualenv/bin/mayan-edms.py initialsetup; \ + pip install mock==2.0.0; \ + _virtualenv/bin/mayan-edms.py test --mayan-apps \ + ' + +wheel_test_suit: wheel + rm -f -R _virtualenv + virtualenv _virtualenv + sh -c '\ + . _virtualenv/bin/activate; \ + pip install `ls dist/*.whl`; \ + _virtualenv/bin/mayan-edms.py initialsetup; \ + pip install mock==2.0.0; \ + _virtualenv/bin/mayan-edms.py test --mayan-apps \ + ' + # Dev server runserver: