Skip to content
Snippets Groups Projects

Introduce a collective library containing all the tools required by hive python tests

Merged Mateusz Żebrak requested to merge mzebrak/poetry-tests into develop

Related: haf!211 (merged), HAfAH!56 (merged)

Best to review by commits since there are many changes.

Created hive-local-tools installable package, which could be installed to provide nice access to all the tools used by hive tests. Now all things could be imported like from hive_local_tools import run_for

The hive-local-tools consists of (sub)modules/packages:

  • hive_local_tools (package -> all local_tools collected in one package, there are nested subpackages like hive_local_tools.functional.python.cli_wallet)
  • shared-tools (package, maybe in future should be submodule also -> tools shared by different repositories e.g hive, haf)
  • test-tools (submodule)
  • schemas (submodule)
  • hive_utils (package*)
  • test_utils(package* located as in previous location - in hive_local_tools.functional.python.beem.decentralized_hive_fund)
  • tests_api (package*)

packages with * (hive_utils, test_utils, tests_api) should be probably refactored/rewritten/removed as they do not follow rules present in our current tests (test-tools, shared-tools, local-tools scheme). Probably some of it's parts should be stored in hive_local_tools, but after refactoring, since at first glance it looks like there is a lot of unused code (ft. hive_utils).

Also, hive-local-tools defines its own dependencies like pytest, pytest-xdist, and so on...

This MR gives some benefits:

  • all test dependencies installable by single line
  • absolute imports instead of huge amount of relative dots (from ......local_tools)
  • no need for PYTHONPATH hacks, as everything is pip/poetry* installable
  • possibility to introduce some static code analysis tools for tests like automated imports sorter or code formatted (shorter review, faster coding)

*preferable poetry as some of it's features lacks in pip package manager, but pip could also install poetry builds, when no poetry features are configures

Edited by Mateusz Żebrak

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Bartek Wrona
  • Author Developer

    rebased

  • Mateusz Żebrak added 24 commits

    added 24 commits

    • 18c3fb49...2a79d97f - 8 commits from branch develop
    • 4e114b21 - Rename installable packages to replace `_` with `-`
    • ec998974 - Move shared_tools package out of package called package
    • 40f69c6f - Update shared-tools pyproject.toml and poetry.lock
    • 7fe3b0c3 - Create base of package called hive-local-tools
    • 9adcd0c6 - Move all python tests related modules inside hive-local-tools
    • 7afaf59b - Move all local_tools modules inside hive_local_tools package
    • d8c627ea - Move test_utils inside hive_local_tools package
    • c6f3092e - Specify hive-local-tools dependencies
    • 2aba8b1e - Generate the poetry.lock file
    • fe15d757 - Adapt imports to absolute hive-local-tools
    • 48cd078a - Adapt decentralized_hive_fund_tests imports
    • e390f14c - Move shared_utilities to local_tools
    • 16249834 - Update path of transaction patterns
    • f250dada - Update CMakeLists.txt with new directory of tests_api
    • cf4b08b4 - Update tests_api path in tox.ini
    • 02f7fa9f - Adjust .gitlab-ci.yaml to installable test dependencies package

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading