fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

Split tests into core/tasks #391

Closed tcompa closed 1 year ago

tcompa commented 1 year ago

After #378, we should also run the tests in two batches: the ones for the core functions, and the ones for the whole package that also include tasks. This will protect us from issues like "I added a cellpose dependency in the core library". Not the most urgent thing to do, but it's always good to improve the tooling of the repo/package.

Note that pytest does offer some kind of test labels (which we would also use to run the CI locally), but we'll still need to properly set up the GitHub action so that:

  1. It installs the core part
  2. It runs the core tests
  3. It install the tasks extra
  4. It runs the tasks tests
  5. It creates a unique coverage report
tcompa commented 1 year ago

For the record, this is the command that runs even without package extras:

poetry run pytest -x -v --ignore tests/test_unit_napari_workflows_wrapper.py --ignore tests/test_unit_parse_yokogawa_metadata.py --ignore tests/test_workflows_napari_workflows   --ignore tests/test_workflows_cellpose_segmentation.py --ignore tests/test_workflows_napari_workflows.py --ignore tests/test_import.py --ignore tests/test_valid_args_schemas.py --ignore tests/test_valid_task_interface.py
tcompa commented 1 year ago

Side comment: splitting the tests into core+tasks will also make it clear that some of our core modules require a much more thorough test coverage, e.g. I just realized that lib_masked_loading.py has a very poor one.

For a task, it could be complex to create and maintain test data for all branches, but for the core modules I think we should aim for a very high quality (this is especially true because we plan to have other packages depending on the core part).

jluethi commented 1 year ago

Agreed!

I also just realized how complex this can become for the napari workflows task when looking at the different 2D & 3D branches, those are hard to test exhaustively. But we should aim for high test coverage over our library functions.

tcompa commented 1 year ago

425 implements a first version of this split in tests

What is covered is:

Out of scope, for now: