{ "info": { "author": "swissglider", "author_email": "check@github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Environment :: Web Environment", "Framework :: Flask", "Framework :: Pytest", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6" ], "description": "# Python test Environment\n\n@Swissglider \n## short description\n\nThis image creates the base image for the Pythontest Environment\nClass SGPytest for run tests against Source Code and runs unittest\n## how to install (only this makes sense ;-))\n\n- the Project to test (with setup.py etc..) are in: `~/developer/project1`\n```sh\ndocker run -d --name sg_test_env -e TZ=Europe/Zurich -p 80:8888 -v ~/developer/project1:/data -w /app swissglider/sg_test_env:latest\ndocker exec -it sg_test_env tail -f /tmp/uwsgi.log\ndocker exec -it sg_test_env bash\n```\n## For other reasons (debugging / logs)\n\n#### From Docker Hub\n```sh\ndocker run -it --rm -p 80:8888 -e TZ=Europe/Zurich -w /app swissglider/sg_test_env:latest /start.sh\n\n# or\n\ndocker run -d --name sg_test_env -p 80:8888 -e TZ=Europe/Zurich -w /app swissglider/sg_test_env:latest\ndocker exec -it sg_test_env bash\ndocker exec -it sg_test_env tail -f /tmp/uwsgi.log\n```\n#### From Github\n\n```sh\ndocker build -t sg_test_env_i https://raw.githubusercontent.com/swissglider/SG_Test_Env/master/Dockerfile\ndocker -it --rm -p 80:8888 -e TZ=Europe/Zurich sg_test_env_i /start.sh\n\n# or\n\ndocker build -t sg_test_env_i https://raw.githubusercontent.com/swissglider/SG_Test_Env/master/Dockerfile\ndocker run -d --name sg_test_env -p 80:8888 -e TZ=Europe/Zurich -w /app sg_test_env_i\ndocker exec -it sg_test_env bash\ndocker exec -it sg_test_env tail -f /tmp/uwsgi.log\n```\n#### From Dockerfile\n```sh\ndocker build -t sg_test_env_i -f Dockerfile .\ndocker -it --rm -p 80:8888 -e TZ=Europe/Zurich sg_test_env_i /start.sh\ndocker -it --rm -p 80:8888 -e TZ=Europe/Zurich sg_test_env_i bash\n\n# or\n\ndocker build -t sg_test_env_i -f Dockerfile .\ndocker run -d --name sg_test_env -p 80:8888 -e TZ=Europe/Zurich -w /app sg_test_env_i\ndocker exec -it sg_test_env bash\ndocker exec -it sg_test_env tail -f /tmp/uwsgi.log\n```\n#### For debugging flask\n```sh\ndocker run -d --name sg_test_env -e TZ=Europe/Zurich -p 8888:8888 -v ~/developer/SG_Test_Env:/data -e FLASK_APP=main.py -e FLASK_DEBUG=1 swissglider/sg_test_env:latest bash -c \"while true ; do sleep 10 ; done\"\ndocker exec -it sg_test_env bash\nflask run --host=0.0.0.0 --port=8888\n\n\ndocker run -it --rm -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env/:/app -w /app swissglider/sg_test_env:test sh install_script/sg_flask.sh\ndocker run -it --rm -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env/:/app -w /app swissglider/sg_test_env:test sh install_script/sg_clean.sh\n\n```\n## Install it for test in test docker python\n\n```sh\ndocker run -it --rm --name sg_test_env -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env:/data -v ~/developer/SG_Test_Env:/app -w /data python:3.6.6 sh sg_flask.sh\n\ndocker run -it --rm --name sg_test_env -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env:/data -v ~/developer/SG_Test_Env -w /data python:3.6.6 bash\n\n# Clean environment:\nsh ./install_script/sg_clean.ch\n\n# Test Pytest standalone - 1:\n pytest testing src --html=/data/src/sg_pytest/webapp/static/test.html --cov=src --cov-report=html:/data/src/sg_pytest/webapp/static/cov\n\n# Test Pytest standalone - 2:\ndocker run -it --rm --name sg_test_env -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env:/data -v ~/developer/SG_Test_Env:/app -w /data python bash\npip install pytest\npip install pytest-cov\npip install pytest-html\npip install -e .\npytest --html=src/sg_pytest/webapp/static/test.html --cov --cov-report=html:src/sg_pytest/webapp/static/cov/ -s -vv\n\n# Test setup.py test standalone - 3:\ndocker run -it --rm --name sg_test_env -e TZ=Europe/Zurich -p 80:80 -v ~/developer/SG_Test_Env:/data -v ~/developer/SG_Test_Env:/app -w /data python:3.6.5 bash\npython setup.py test\nsh sg_clean.sh\n\n\ndocker run -it --rm --name sg_test_env -e TZ=Europe/Zurich -v ~/developer/SG_Test_Env:/app -w /app python:3.6.5 bash\npython setup.py test\nsh ./install_script sg_clean.sh\n```\n## SG_Test_Env Tests\n```sh\n# standalone\ndocker run -it --rm -e TZ=Europe/Zurich -w /app swissglider/sg_test_env:test python setup.py test\n\n# with own app (wiht setup.py and tests etc)\ndocker run -it --rm -e TZ=Europe/Zurich -v ~/developer/SG_Test_Env:/app -w /app swissglider/sg_test_env:test bash\npython setup.py test\n\n# with access to static dir to get html output\ndocker run -it --rm -e TZ=Europe/Zurich -v ~/developer/static:/static -w /app swissglider/sg_test_env:test bash\npython setup.py test\n\n# with own test data \ndocker run -it --rm -e TZ=Europe/Zurich -v ~/developer/test_data:/data -w /app swissglider/sg_test_env:test bash\npython setup.py test\n```\n## Directory architecture - Volumes\n\n- code\n - setup.py\n - setup.cfg\n - README.md\n - plugin_packages.txt\n - requirements.txt\n - sg_pytest.ini\n - test_requirements.txt\n - src (source Directory)\n - test (test files)\n\n- tmp_home\n - .pypirc\n#### samples see \n- https://github.com/swissglider/SG_Test_Env\n- https://github.com/swissglider/SG_Test_Env/tree/master/testing/data\n\n\n## How to use it test framework\n\n## How to build\n\n[see howto Github build pypi](https://www.codementor.io/arpitbhayani/host-your-python-package-using-github-on-pypi-du107t7ku)\n\n### .pypirc\n\n```cfg\n[distutils]\nindex-servers =\n pypi\n pypitest\n\n[pypi]\nrepository: https://pypi.python.org/pypi\nusername: YOUR_USERNAME_HERE\npassword: YOUR_PASSWORD_HERE\n\n[pypitest]\nrepository: https://testpypi.python.org/pypi\nusername: YOUR_USERNAME_HERE\npassword: YOUR_PASSWORD_HERE\n```\n\n## Open\n\n- make pypi\n- clean in web gui", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/swissglider/SG_Test_Env", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sg-test-env", "package_url": "https://pypi.org/project/sg-test-env/", "platform": "", "project_url": "https://pypi.org/project/sg-test-env/", "project_urls": { "Homepage": "https://github.com/swissglider/SG_Test_Env" }, "release_url": "https://pypi.org/project/sg-test-env/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "This is the SG_Test_Env Project", "version": "0.0.1" }, "last_serial": 4187858, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1441921be75863089aea3e7d802ae61d", "sha256": "499b9d61d3470d6bba59632bc40d5481736f5e56ddeb474f63ec47dba9eb769f" }, "downloads": -1, "filename": "sg_test_env-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1441921be75863089aea3e7d802ae61d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7816, "upload_time": "2018-08-20T10:07:26", "url": "https://files.pythonhosted.org/packages/fd/91/1f610b5334c1c860c1c19e8b1b2524a3a773cc846a6e280ab781b13097f1/sg_test_env-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1441921be75863089aea3e7d802ae61d", "sha256": "499b9d61d3470d6bba59632bc40d5481736f5e56ddeb474f63ec47dba9eb769f" }, "downloads": -1, "filename": "sg_test_env-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1441921be75863089aea3e7d802ae61d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7816, "upload_time": "2018-08-20T10:07:26", "url": "https://files.pythonhosted.org/packages/fd/91/1f610b5334c1c860c1c19e8b1b2524a3a773cc846a6e280ab781b13097f1/sg_test_env-0.0.1.tar.gz" } ] }