This commit is contained in:
Colm O'Connor 2015-09-24 07:41:19 +00:00
commit 206105f2fb
7 changed files with 70 additions and 39 deletions

View File

@ -55,3 +55,4 @@ node_modules/
# virtual environments # virtual environments
.env .env
.hitch

View File

@ -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

View File

@ -1,4 +0,0 @@
{% raw %}{% for python_version in python_versions %}
{% block test scoped %}
{% endblock %}
{% endfor %}{% endraw %}

View File

@ -18,9 +18,11 @@ class ExecutionEngine(hitchtest.ExecutionEngine):
def set_up(self): def set_up(self):
"""Ensure virtualenv present, then run all services.""" """Ensure virtualenv present, then run all services."""
python_package = hitchpython.PythonPackage( {% if cookiecutter.use_python2 == 'n' -%}
python_version=self.preconditions['python_version'] python_package = hitchpython.PythonPackage("2.7.10")
) {%- else -%}
python_package = hitchpython.PythonPackage("3.5.0")
{%- endif %}
python_package.build() python_package.build()
python_package.verify() python_package.verify()
@ -45,12 +47,20 @@ class ExecutionEngine(hitchtest.ExecutionEngine):
shutdown_timeout=5.0, 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( self.services['Postgres'] = hitchpostgres.PostgresService(
postgres_package=postgres_package, postgres_package=postgres_package,
users=[postgres_user, ], 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) self.services['HitchSMTP'] = hitchsmtp.HitchSMTPService(port=1025)

View File

@ -1,26 +1,41 @@
click==5.1 click==5.1
colorama==0.3.3 colorama==0.3.3
decorator==4.0.2
docopt==0.6.2
faketime==0.9.6.3 faketime==0.9.6.3
hitchcron==0.2 hitchcron==0.2
hitchpostgres==0.6.3 hitchpostgres==0.6.3
hitchpython==0.3.5 hitchpython==0.3.6
hitchredis==0.4.3 hitchredis==0.4.3
hitchselenium==0.4.1 hitchselenium==0.4.3
hitchserve==0.4.4 hitchserve==0.4.5
hitchsmtp==0.2.1 hitchsmtp==0.2.1
hitchtest==0.8.0 hitchtest==0.8.0
humanize==0.5.1 humanize==0.5.1
ipykernel==4.0.3
ipython==4.0.0 ipython==4.0.0
ipython-genutils==0.1.0
Jinja2==2.8 Jinja2==2.8
jupyter-client==4.0.0
jupyter-console==4.0.2
jupyter-core==4.0.6
MarkupSafe==0.23 MarkupSafe==0.23
path.py==8.1.1
patool==1.8 patool==1.8
pexpect==3.3
pickleshare==0.5
psutil==3.2.1 psutil==3.2.1
pykwalify==1.4.1
python-build==0.2.3 python-build==0.2.3
python-dateutil==2.4.2
pyuv==1.2.0 pyuv==1.2.0
PyYAML==3.11 PyYAML==3.11
pyzmq==14.7.0
requests==2.7.0 requests==2.7.0
selenium==2.47.3 selenium==2.47.3
simplegeneric==0.8.1
six==1.9.0 six==1.9.0
tblib==1.1.0 tblib==1.1.0
tornado==4.2.1 tornado==4.2.1
xeger==0.3 traitlets==4.0.0
unixpackage==0.3.2

View File

@ -1,6 +1,6 @@
postgres_version: 9.3.9 postgres_version: 9.3.9
redis_version: 2.8.4 redis_version: 2.8.4
django_version: 1.8.3 django_version: 1.8.4
celery_version: 3.1.18 celery_version: 3.1.18
pause_on_success: false pause_on_success: false
pause_on_failure: true 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}} 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=+ SECRET_KEY: cj5^uos4tfCdfghjkf5hq$9$(@-79^e9&x$3vyf#igvsfm4d=+
CELERY_BROKER_URL: redis://localhost:16379 CELERY_BROKER_URL: redis://localhost:16379
DJANGO_EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
window_size: window_size:
width: 450 width: 450
height: 450 height: 450
@ -18,26 +19,11 @@ environment:
- approved_platforms: - approved_platforms:
- linux - linux
- darwin - darwin
- freeports: - packages:
- 1025
- 8000
- 15432
- 16379
- brew:
- libtool
- automake
- node
- debs:
- python-setuptools
- python3-dev
- python-virtualenv
- python-pip
- firefox - firefox
- automake - automake
- libtool - libtool
- libreadline6
- libreadline6-dev - libreadline6-dev
- libreadline-dev
- libsqlite3-dev - libsqlite3-dev
- libpq-dev - libpq-dev
- libxml2 - libxml2
@ -55,5 +41,3 @@ environment:
- libwebp-dev - libwebp-dev
- zlib1g-dev - zlib1g-dev
- gettext - gettext
- python-dev
- build-essential

View File

@ -1,10 +1,4 @@
{% raw %}{% extends "base.yml" %} - name: Stub
{% block test %}
- engine: engine.py:ExecutionEngine
name: Stub {{ python_version }}
preconditions:
python_version: "{{ python_version }}"
scenario: scenario:
- Load website - Load website
- Pause - Pause
{% endblock %}{% endraw %}