When running pytest --cov after the correct configuration has been set, the CLI tests still fail with an error:
======================================= short test summary info =======================================
FAILED tests/test_utils.py::test_import_yaml_users - AssertionError: assert {'environment...'users'], ...} == {'environment...'users'], ...}
due to a mismatch between the template users.local.yml and the expected YAML object - the template contains restart: 'unless-stopped' which does not exist in the expected object. The solution is to simply add this key-value pair to the expected object.
To Reproduce
After setting up your configuration, run the following:
$ cd cli
$ poetry shell
$ pytest --cov
Additional Notes
There are some low hanging fruits we can improve the developer experience with:
Files generated by the tests (.coverage, compose.users.exp.yml, etc) are being emitted into the source directory, which pollutes the git workspace. Maybe they could be placed in something like .tmp that is gitignored?
On a similar note, we can extend the current .gitignore with this Python gitignore template made by github, so auto-generated folders like __pycache__ don't get included.
Before running all tests, remember to set the appropriate path in dtaas.toml. Also set this same path in the dictionary in test_utils.py, in the test_import_toml function.
But test_import_toml simply tests the functionality of utils.importToml by reading dtaas.test.toml and NOT the main dtaas.toml file, so where/why should the path to the DTaaS directory be set?
CLI Tests Fail
When running
pytest --cov
after the correct configuration has been set, the CLI tests still fail with an error:due to a mismatch between the template
users.local.yml
and the expected YAML object - the template containsrestart: 'unless-stopped'
which does not exist in the expected object. The solution is to simply add this key-value pair to the expected object.To Reproduce
After setting up your configuration, run the following:
Additional Notes
There are some low hanging fruits we can improve the developer experience with:
.coverage
,compose.users.exp.yml
, etc) are being emitted into the source directory, which pollutes the git workspace. Maybe they could be placed in something like.tmp
that is gitignored?.gitignore
with this Python gitignore template made by github, so auto-generated folders like__pycache__
don't get included.cli/DEVELOPER.md mentions:
But
test_import_toml
simply tests the functionality ofutils.importToml
by readingdtaas.test.toml
and NOT the maindtaas.toml
file, so where/why should the path to the DTaaS directory be set?