Skip to content

fix code coverage configuration in components to work better in IDEs #553

@ms-lolo

Description

@ms-lolo

code coverage integration with IDEs has always been shaky, but we have a couple working examples across different repos. we should update our pyproject.toml files in rats to shift some of the configuration from tool.coverage.run to tool.pytest.ini_options, because it allows IDEs to better parse the results and show the coverage report in the native IDE ux. i think these changes don't affect the output when running pytest in a terminal.

  • the tool.coverage.run section should only have a data_file and relative_files config
    • do not specify branch because it break's the IDE's ability to use branching options
    • do not specify source values, i'm unsure why this breaks things, but it's not necessary
  • in tool.pytest.ini_options
    • add a --cov option for each source directory we were previously defining in coverage configs
    • enable --cov-branch

part of this work should also include documentation to explain how to configure your projects in similar ways.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions