Skip to content
Snippets Groups Projects

Add integration tests for db2json and json2db

Merged David Runge requested to merge issues/9 into master
  1. Mar 20, 2021
    • David Runge's avatar
      Add integration tests to gitlab CI · 9ba649d1
      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`.
      Verified
      9ba649d1
    • David Runge's avatar
      Add integration test target for tox · 441d7c00
      David Runge authored
      tox.ini:
      Add test target that only runs tests marked "integration".
      Verified
      441d7c00
    • David Runge's avatar
      Extend tests for CLI and add integration tests · aaf40e02
      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.
      Verified
      aaf40e02
    • David Runge's avatar
      Add pytest configuration for markers · e47f74bd
      David Runge authored
      pyproject.toml:
      Add pytest configuration to setup the custom marker "integration".
      Verified
      e47f74bd
    • David Runge's avatar
      Improve Exception handling in convert · 6e821be6
      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.
      Verified
      6e821be6
    • David Runge's avatar
      Add commands module to run external commands · ac42d90a
      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()`.
      Verified
      ac42d90a
    • David Runge's avatar
      Update lock file for subprocess-tee · f588beec
      David Runge authored
      poetry.lock:
      Update lock file for subprocess-tee 0.2.0.
      Verified
      f588beec
    • David Runge's avatar
      Add subprocess-tee to dependencies · 899cc204
      David Runge authored
      pyproject.toml:
      Add subprocess-tee to the list of dependencies for the project.
      Verified
      899cc204
Loading