Commit 4dda62a2 authored by André Anjos's avatar André Anjos 💬
Browse files

[testing] Remove nose runner, simplify testing

parent 669ed8d7
......@@ -18,7 +18,8 @@ sphinx/
.DS_Store
beat/web/settings/settings.py
src/
web_dynamic_data*
prefix/
test_prefix/
.nfs*
beat/web/static/
doc/api/api/
......
......@@ -185,13 +185,13 @@ populate a development webserver::
every combination of database and version you wish to support, run the
following command::
$ ./bin/beat -p web_dynamic_data db index <name>/<version>
$ ./bin/beat -p prefix db index <name>/<version>
Replacing the strings ``<name>`` by the name of the database you wish to dump
the indices for, together with the version in ``<version>``. For example, to
dump the indices for the AT&T database, version 1, do the following::
$ ./bin/beat -p web_dynamic_data db index atnt/1
$ ./bin/beat -p prefix db index atnt/1
Once the contributions and users are in place, you're ready to start the test
server::
......@@ -287,7 +287,8 @@ You may pass filtering criteria to just launch tests for a particular set of
To measure coverage, you must set an environment variable for nose::
$ NOSE_WITH_COVERAGE=1 NOSE_COVER_PACKAGE=beat.web ./bin/django test --settings=beat.web.settings.test -v 2
$ ./bin/coverage run --source='./beat/web' ./bin/django test --settings=beat.web.settings.test
$ ./bin/coverage report
.. _snapshot:
......@@ -331,7 +332,7 @@ current state of a production system.
4. Remove the current local development database so that the restore operation
can start from scratch::
[development]$ rm -rf django.sql3 web_dynamic_data
[development]$ rm -rf django.sql3 prefix
5. Copy the backup tarball from the production server and restore it locally::
......@@ -388,10 +389,10 @@ migration test loop.
This backup will allow you to quickly test the migrations w/o having to
checkout the production version anymore.
Also, create a temporary git repository of ``web_dynamic_data``, so you can
Also, create a temporary git repository of ``prefix``, so you can
cross-check changes and reset it in case of problems::
$ cd web_dynamic_data
$ cd prefix
$ git init .
$ git add .
$ git commit -m "Initial commit"
......@@ -415,7 +416,7 @@ migration test loop.
c. If a problem is detected, fix it and revert the state::
$ cp -af django.sql3.backup django.sql3
$ cd web_dynamic_data && git reset --hard HEAD && git clean -fdx . & cd ..
$ cd prefix && git reset --hard HEAD && git clean -fdx . & cd ..
.. note::
......
......@@ -133,7 +133,7 @@ STATIC_ROOT = 'static'
#
##############################################################################
PREFIX = os.path.join(os.getcwd(), 'web_dynamic_data')
PREFIX = os.path.join(os.getcwd(), 'prefix')
ALGORITHMS_ROOT = os.path.join(PREFIX, 'algorithms')
PLOTTERS_ROOT = os.path.join(PREFIX, 'plotters')
LIBRARIES_ROOT = os.path.join(PREFIX, 'libraries')
......@@ -299,9 +299,6 @@ RESTRUCTUREDTEXT_FILTER_SETTINGS = {
'raw_enabled': 0,
}
# Use nose to run tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Where CodeMirror is installed and some other settings
CODEMIRROR_PATH = 'codemirror' #w.r.t to STATIC_URL
CODEMIRROR_THEME = 'default'
......
......@@ -37,15 +37,9 @@ ALLOWED_HOSTS = [
]
# To always use a (in-memory) sqlite3 database for the tests
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
DATABASES['default'] = { 'ENGINE': 'django.db.backends.sqlite3' }
PREFIX = os.path.join(os.getcwd(), 'web_dynamic_data_tests')
PREFIX = os.path.join(os.getcwd(), 'test_prefix')
ALGORITHMS_ROOT = os.path.join(PREFIX, 'algorithms')
LIBRARIES_ROOT = os.path.join(PREFIX, 'libraries')
DATABASES_ROOT = os.path.join(PREFIX, 'databases')
......@@ -54,13 +48,7 @@ TOOLCHAINS_ROOT = os.path.join(PREFIX, 'toolchains')
EXPERIMENTS_ROOT = os.path.join(PREFIX, 'experiments')
CACHE_ROOT = os.path.join(PREFIX, 'cache')
# To speed-up tests, don't put this in production
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
)
]
......@@ -19,7 +19,6 @@ versions = versions
django = >=1.8,<1.9
django-rest-swagger = >=0.3.2
django-guardian = >=1.3
django-nose = >=1.4.1
djangorestframework = >=3.2
[sysegg]
......@@ -38,7 +37,6 @@ eggs = alabaster
django-activity-stream
django_guardian
django-jsonfield
django_nose
djangorestframework
django-rest-swagger
docopt
......
......@@ -55,7 +55,6 @@ setup(
"django-activity-stream",
"django-jsonfield",
"django-guardian",
"django_nose",
"djangorestframework",
"django-rest-swagger",
"docopt",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment