diff --git a/{{cookiecutter.repo_name}}/.gitignore b/{{cookiecutter.repo_name}}/.gitignore index 13567ebd0..884c920d1 100644 --- a/{{cookiecutter.repo_name}}/.gitignore +++ b/{{cookiecutter.repo_name}}/.gitignore @@ -55,3 +55,4 @@ node_modules/ # virtual environments .env +.hitch diff --git a/{{cookiecutter.repo_name}}/tests/README.rst b/{{cookiecutter.repo_name}}/tests/README.rst new file mode 100644 index 000000000..b5403bfbc --- /dev/null +++ b/{{cookiecutter.repo_name}}/tests/README.rst @@ -0,0 +1,31 @@ +Hitch tests +=========== + +Note: This has been tested on up to date versions Debian, Ubuntu, Arch and +Mac OS X (Mavericks). + +To initialize and run the hitch tests in your project, enter this (tests) directory and +run the following command:: + + $ curl -sSL https://hitchtest.com/init.sh > init.sh ; chmod +x init.sh ; ./init.sh + +Note: if you are running Mac OS X you will need to install firefox as well. +You can do this while it is running. + +This should download install all the necessary packages and run the stub test. +It will take about 10 or 15 minutes to set up. + +Once it is ready, you should see a browser window and an interactive IPython prompt:: + + IPython 4.0.0 -- An enhanced Interactive Python. + ? -> Introduction and overview of IPython's features. + %quickref -> Quick reference. + help -> Python's own help system. + object? -> Details about 'object', use 'object??' for extra details. + + In [1]: + +For more documentation on hitch, see: https://hitchtest.readthedocs.org/en/latest/api/index.html + +If anything goes wrong during the set up process, please raise an issue at +https://github.com/hitchtest/hitch/issues diff --git a/{{cookiecutter.repo_name}}/tests/base.yml b/{{cookiecutter.repo_name}}/tests/base.yml deleted file mode 100644 index 844f12712..000000000 --- a/{{cookiecutter.repo_name}}/tests/base.yml +++ /dev/null @@ -1,4 +0,0 @@ -{% raw %}{% for python_version in python_versions %} -{% block test scoped %} -{% endblock %} -{% endfor %}{% endraw %} diff --git a/{{cookiecutter.repo_name}}/tests/engine.py b/{{cookiecutter.repo_name}}/tests/engine.py index 388b08fde..36b8c0feb 100644 --- a/{{cookiecutter.repo_name}}/tests/engine.py +++ b/{{cookiecutter.repo_name}}/tests/engine.py @@ -18,9 +18,11 @@ class ExecutionEngine(hitchtest.ExecutionEngine): def set_up(self): """Ensure virtualenv present, then run all services.""" - python_package = hitchpython.PythonPackage( - python_version=self.preconditions['python_version'] - ) + {% if cookiecutter.use_python2 == 'n' -%} + python_package = hitchpython.PythonPackage("2.7.10") + {%- else -%} + python_package = hitchpython.PythonPackage("3.5.0") + {%- endif %} python_package.build() python_package.verify() @@ -45,12 +47,20 @@ class ExecutionEngine(hitchtest.ExecutionEngine): shutdown_timeout=5.0, ) - postgres_user = hitchpostgres.PostgresUser("{{cookiecutter.repo_name}}", "password") + postgres_user = hitchpostgres.PostgresUser( + "{{cookiecutter.repo_name}}", + "password" + ) self.services['Postgres'] = hitchpostgres.PostgresService( postgres_package=postgres_package, users=[postgres_user, ], - databases=[hitchpostgres.PostgresDatabase("{{cookiecutter.repo_name}}", postgres_user), ] + databases=[ + hitchpostgres.PostgresDatabase( + "{{cookiecutter.repo_name}}", + postgres_user + ), + ] ) self.services['HitchSMTP'] = hitchsmtp.HitchSMTPService(port=1025) diff --git a/{{cookiecutter.repo_name}}/tests/hitchreqs.txt b/{{cookiecutter.repo_name}}/tests/hitchreqs.txt index ddb453bf8..a6125a695 100644 --- a/{{cookiecutter.repo_name}}/tests/hitchreqs.txt +++ b/{{cookiecutter.repo_name}}/tests/hitchreqs.txt @@ -1,26 +1,41 @@ click==5.1 colorama==0.3.3 +decorator==4.0.2 +docopt==0.6.2 faketime==0.9.6.3 hitchcron==0.2 hitchpostgres==0.6.3 -hitchpython==0.3.5 +hitchpython==0.3.6 hitchredis==0.4.3 -hitchselenium==0.4.1 -hitchserve==0.4.4 +hitchselenium==0.4.3 +hitchserve==0.4.5 hitchsmtp==0.2.1 hitchtest==0.8.0 humanize==0.5.1 +ipykernel==4.0.3 ipython==4.0.0 +ipython-genutils==0.1.0 Jinja2==2.8 +jupyter-client==4.0.0 +jupyter-console==4.0.2 +jupyter-core==4.0.6 MarkupSafe==0.23 +path.py==8.1.1 patool==1.8 +pexpect==3.3 +pickleshare==0.5 psutil==3.2.1 +pykwalify==1.4.1 python-build==0.2.3 +python-dateutil==2.4.2 pyuv==1.2.0 PyYAML==3.11 +pyzmq==14.7.0 requests==2.7.0 selenium==2.47.3 +simplegeneric==0.8.1 six==1.9.0 tblib==1.1.0 tornado==4.2.1 -xeger==0.3 +traitlets==4.0.0 +unixpackage==0.3.2 diff --git a/{{cookiecutter.repo_name}}/tests/settings.yml b/{{cookiecutter.repo_name}}/tests/settings.yml index 7ea14f07e..c3b0c8e2f 100644 --- a/{{cookiecutter.repo_name}}/tests/settings.yml +++ b/{{cookiecutter.repo_name}}/tests/settings.yml @@ -1,6 +1,6 @@ postgres_version: 9.3.9 redis_version: 2.8.4 -django_version: 1.8.3 +django_version: 1.8.4 celery_version: 3.1.18 pause_on_success: false pause_on_failure: true @@ -9,6 +9,7 @@ environment_variables: DATABASE_URL: postgres://{{cookiecutter.repo_name}}:password@127.0.0.1:15432/{{cookiecutter.repo_name}} SECRET_KEY: cj5^uos4tfCdfghjkf5hq$9$(@-79^e9&x$3vyf#igvsfm4d=+ CELERY_BROKER_URL: redis://localhost:16379 + DJANGO_EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend window_size: width: 450 height: 450 @@ -18,26 +19,11 @@ environment: - approved_platforms: - linux - darwin - - freeports: - - 1025 - - 8000 - - 15432 - - 16379 - - brew: - - libtool - - automake - - node - - debs: - - python-setuptools - - python3-dev - - python-virtualenv - - python-pip + - packages: - firefox - automake - libtool - - libreadline6 - libreadline6-dev - - libreadline-dev - libsqlite3-dev - libpq-dev - libxml2 @@ -55,5 +41,3 @@ environment: - libwebp-dev - zlib1g-dev - gettext - - python-dev - - build-essential diff --git a/{{cookiecutter.repo_name}}/tests/stub.test b/{{cookiecutter.repo_name}}/tests/stub.test index 88b4a1d0d..7772217d3 100644 --- a/{{cookiecutter.repo_name}}/tests/stub.test +++ b/{{cookiecutter.repo_name}}/tests/stub.test @@ -1,10 +1,4 @@ -{% raw %}{% extends "base.yml" %} -{% block test %} -- engine: engine.py:ExecutionEngine - name: Stub {{ python_version }} - preconditions: - python_version: "{{ python_version }}" +- name: Stub scenario: - Load website - Pause -{% endblock %}{% endraw %}