Add preliminary automated tests #1

Merged
3wordchant merged 16 commits from tests into master 2021-08-16 00:11:16 +00:00

16 Commits

Author SHA1 Message Date
3wc 13b2c05476 gitignore unittest output file
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2021-08-16 02:07:36 +02:00
forest 5f9fc1adcf create TestHTTPClient that uses werkzueg test client, tests are passing 2021-08-16 02:07:36 +02:00
forest 16ff1b5b26 documenting the janky tests logs situation 2021-08-16 02:07:36 +02:00
forest 8c10f71f58 getting unit tests to log properly 2021-08-16 02:07:36 +02:00
forest 66dee4d87a breaking up after abusive relationship with logger 2021-08-16 02:07:36 +02:00
forest 6a587ac7fc trying to do CaptureLogOutputDuringTestsFilter (but no worky yet) 2021-08-16 02:07:36 +02:00
forest 4e510ebb01 blah failed attempts at getting tests to log 2021-08-16 02:07:36 +02:00
forest 140870ec35 add debug test log 2021-08-16 02:07:36 +02:00
forest 2348191990 trying to get tests to pass with hub_model=capsulflask 2021-08-16 02:07:36 +02:00
forest 5e682cc705 remove redundant get_vms() and add testing documentation from pull
request
2021-08-16 02:07:36 +02:00
3wc 2b33573890 Fix capsul create tests, post-test cleanup, tidy merge 2021-08-16 02:07:36 +02:00
forest da4d28f70c ensure that app is defined in app.py to fix login link logging issues.
also shuffled some things around for cleanliness
2021-08-16 02:07:36 +02:00
3wc d833b3df19 Disable VM creation check for the moment 2021-08-16 02:07:36 +02:00
3wc 46a40261bb Add SSH key tests 2021-08-16 02:07:36 +02:00
3wc b108d4c04e Initial console tests
NB capsul create isn't working properly, see #83
2021-08-16 02:07:36 +02:00
3wc 6bd02a660e Basic testing using flask-testing
This commit makes it possible to override settings during tests, by
switching capsulflask/__init__.py to a "create_app" pattern, and using
`dotenv_values` instead of `load_dotenv`.

The create_app() method returns a Flask app instance, to give
more control over when to initialise the app. This allows setting
environment variables in test files.

Then, use dotenv_values to override loaded .env variables with ones from
the environment, so that tests can set `POSTGRES_CONNECTION_PARAMETERS`
and `SPOKE_MODEL` (possibly others in future..).

Inital tests for the "landing" pages, and login / activation, are
included.
2021-08-16 02:07:34 +02:00