-
-
Notifications
You must be signed in to change notification settings - Fork 782
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
520624a
commit 84a2065
Showing
20 changed files
with
296 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Testing | ||
======= | ||
|
||
All tests can be run using `tox <https://tox.wiki/en/latest/>`_ simply by running the `tox` command. | ||
|
||
By default, tests are run against a local sqlite2 instance, however you can also use docker to test against MySQL and Postgres databases as follows. | ||
|
||
First, set environment variables. Note that the ``IMPORT_EXPORT_TEST_TYPE`` must be set according to the type of tests you wish to run. Set to 'postgres' for postgres tests, and 'mysql-innodb' for mysql tests. If this environment variable is blank (or is any other value) then the default sqlite2 db will be used. | ||
|
||
.. code-block:: bash | ||
export DJANGO_SETTINGS_MODULE=settings | ||
export IMPORT_EXPORT_POSTGRESQL_USER=pguser | ||
export IMPORT_EXPORT_POSTGRESQL_PASSWORD=pguserpass | ||
export IMPORT_EXPORT_MYSQL_USER=mysqluser | ||
export IMPORT_EXPORT_MYSQL_PASSWORD=mysqluserpass | ||
# for testing against mysql db | ||
export IMPORT_EXPORT_TEST_TYPE=mysql-innodb | ||
# for testing against postgres db | ||
export IMPORT_EXPORT_TEST_TYPE=postgres | ||
Assuming that you have docker installed on your system: | ||
|
||
.. code-block:: bash | ||
docker-compose -f tests/docker-compose.yml up | ||
Now you can run all tests with: ``tox`` | ||
|
||
To shutdown the database and delete all data: | ||
|
||
.. code-block:: bash | ||
docker-compose -f tests/docker-compose.yml down -v | ||
Coverage | ||
######## | ||
|
||
Coverage data is written in parallel mode by default (defined in ``setup.cfg``). After a tox run, you can view coverage data as follows: | ||
|
||
.. code-block:: bash | ||
# combine all coverage data generated by tox into one file | ||
coverage combine | ||
# produce an HTML coverage report | ||
coverage html | ||
Check the output of the above commands to locate the coverage HTML file. | ||
|
||
Continuous Integration | ||
###################### | ||
|
||
The steps defined above are automated for each build. Refer to ``.github/workflows``) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
isort | ||
psycopg2-binary | ||
mysqlclient | ||
coveralls | ||
chardet | ||
pytz | ||
memory-profiler | ||
django-extensions | ||
django-extensions | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.