Skip to content

Unit test naming#2193

Merged
GernotMaier merged 4 commits into
mainfrom
unit-test-naming
May 20, 2026
Merged

Unit test naming#2193
GernotMaier merged 4 commits into
mainfrom
unit-test-naming

Conversation

@GernotMaier
Copy link
Copy Markdown
Contributor

This pull request adds a new check to the continuous integration (CI) workflow to ensure better test coverage by verifying that every Python module in src/simtools (except for __init__.py and files under applications) has a corresponding unit test file.

(trigger by finding a file with a naming mismatch)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the unit-test discipline in simtools by adding a CI workflow check that enforces a 1:1 mapping between Python modules under src/simtools (excluding __init__.py and applications/) and corresponding unit test files under tests/unit_tests/.

Changes:

  • Add a CI step to fail if any src/simtools/**/*.py module lacks a matching tests/unit_tests/**/test_<module>.py.
  • Add a new unit test module for production_configuration/calculate_statistical_uncertainties_grid_point.py.
  • Add a changelog fragment documenting the CI enforcement.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/unit_tests/production_configuration/test_calculate_statistical_uncertainties_grid_point.py Adds unit tests for statistical uncertainty evaluation/production statistics logic.
docs/changes/2193.maintenance.md Documents the new CI enforcement in the changelog.
.github/workflows/CI-unittests.yml Adds a pre-test CI gate that checks module↔test-file presence.

Comment thread .github/workflows/CI-unittests.yml Outdated
Comment thread docs/changes/2193.maintenance.md Outdated
GernotMaier and others added 2 commits May 19, 2026 18:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ctao-sonarqube
Copy link
Copy Markdown

@GernotMaier GernotMaier added the no-changelog-needed No Changelog entry required for this PR label May 20, 2026
@GernotMaier GernotMaier marked this pull request as ready for review May 20, 2026 07:26
@GernotMaier GernotMaier merged commit 71d1412 into main May 20, 2026
20 checks passed
@GernotMaier GernotMaier deleted the unit-test-naming branch May 20, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed No Changelog entry required for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants