Add integration tests for db2json and json2db
- Mar 20, 2021
-
-
David Runge authored
.gitlab-ci.yml: Rename "lint" stage to "test" stage. Change basic target to also update the pacman files databases, as they are required for integration tests. Add integration target to run `tox -e integration`.
-
David Runge authored
tox.ini: Add test target that only runs tests marked "integration".
-
David Runge authored
repo_management/cli.py: Change `db2json` and `json2db` to try/except `errors.RepoManagementError` and `argpase.ArgumentTypeError` and exit with a non-zero return code in that case. tests/test_cli.py: Change the tests for `db2json` and `json2db` to cover potentially raising `errors.RepoManagementError` and `argpase.ArgumentTypeError` and checking whether exiting with a non-zero return code in that case. Add parametrized integration test `test_transform_databases()` that transforms existing pacman .files sync databases to JSON files and back to .files repository databases again. Add parametrized integration `test_transform_databases_and_use_with_pacman()` to transform existing pacman .files sync databases to JSON files and create .files and .db repository databases from them. Afterwards pacman uses the created repository databases to search for packages with the "linux" keyword in them and list the files owned by the "linux" package using the created .files sync databases.
-
David Runge authored
pyproject.toml: Add pytest configuration to setup the custom marker "integration".
-
David Runge authored
repo_management/convert.py: Change the docuemntation of `_desc_data_line_to_dicts()` to reflect, that it may raise ValueError under certain conditions. Change `_desc_data_to_model()` to try/except ValueError raised by `_desc_data_line_to_dicts()` and raise a `errors.REpomanagementValidationError` instead. tests/test_convert.py: Change tests expecting to raise `ValueError` to expect `errors.RepoManagementValidationError` instead.
-
David Runge authored
repo_management/commands.py: Add `run_command()` which allows for running an external command with the help of subprocess-tee. Add the private method `_print_env()` which is used to print the optional environment variables given to `run_command()`. tests/test_commands.py: Add tests for `_print_env()` and `run_command()`.
-
David Runge authored
poetry.lock: Update lock file for subprocess-tee 0.2.0.
-
David Runge authored
pyproject.toml: Add subprocess-tee to the list of dependencies for the project.
-