Job | Status | Coverage |
---|---|---|
Build Status | ||
Lint Status | ||
Unit Tests | ||
Integration Tests |
$ sudo apt update
$ sudo apt install gcc libgdal-dev g++ libhdf5-dev
conda activate tethys
Run the following command from the same directory as the setup.py
$ tethys install -d
Run the following command from the same directory as the setup.py
$ tethys install
Add the following to INSTALLED_APPS
in your settings.py
(tethys/tethys_portal/settings.py):
'datetimewidget',
'django_select2',
'taggit',
This extension has two types of tests: unit tests and integrated tests.
Some of the tests require a test database. The database must be a PostgreSQL 9.6 or higher with the postgis extension intalled. Create an empty database before hand. The default database connection string is:
'postgresql://tethys_super:[email protected]:5435/atcore_tests'
To specify a custom database connection string, define the ATCORE_TEST_DATABASE
environment variable:
export ATCORE_TEST_DATABASE="postgresql://<username>:<password>@<ipaddress>:<port>/<dbname>"
To run unit tests:
$ coverage run --rcfile=coverage.ini -m unittest -v tethysext.atcore.tests.unit_tests
$ coverage report
To run integrated tests, install extension in existing installation of Tethys and run:
$ t
$ coverage run --rcfile=coverage.ini <TETHYS_HOME>/src/manage.py test tethysext.atcore.tests.integrated_tests
$ coverage report
We are using flake8 to enforce the pep 8 standard. Any change to the rules can be made in the tox.ini file.
$ flake8 [dir]
To run all of the test and linting with cumulative coverage:
. test.sh </path/to/tethys/manage.py>
The minified scripts were minified using the harmony branch of uglify-js. For example:
sudo apt install npm
sudo npm install -g mishoo/UglifyJS2#harmony
uglifyjs --compress --mangle -- input.js > input.min.js