Skip to content

Improve test coverage for tools#365

Merged
trz42 merged 17 commits intoEESSI:developfrom
sondrebr:improve_test_coverage
Mar 17, 2026
Merged

Improve test coverage for tools#365
trz42 merged 17 commits intoEESSI:developfrom
sondrebr:improve_test_coverage

Conversation

@sondrebr
Copy link
Copy Markdown
Collaborator

Improves the way tests are handled, and adds a number of tests to improve test coverage.

The tests/ folder is excluded from the coverage report to give a more accurate overview. Also, app.cfg is backed up before running the tests to avoid accidentally overwriting it when running the tests locally.

As for the tests themselves, I've focused on the files in tools/.

Adding this as a draft while I work on a few more tests. If you have any opinions on the style for the tests, I would love to hear them - especially regarding the usage of the pytest.mark.parametrize decorator vs. putting everything in the function definition.

Comment thread tests/test_tools_commands.py Outdated


class MockCommand():
def __init__(self, command, general_args=[], action_filters=MockActionFilter(), build_params=None):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤦 Thanks dog

@sondrebr sondrebr marked this pull request as ready for review February 17, 2026 12:37
Copy link
Copy Markdown
Contributor

@trz42 trz42 left a comment

Choose a reason for hiding this comment

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

Nice PR to improve several aspects of unit tests. A few comments for small improvements. Nothing really critical.

Thanks @sondrebr !

Comment thread tests/conftest.py
Comment thread tests/conftest.py
Comment thread tests/test_task_build.py Outdated
Comment thread tests/test_tools_job_metadata.py Outdated
Comment thread tests/test_tools_job_metadata.py Outdated
Comment thread tests/test_tools_commands.py Outdated
Comment thread tests/test_tools_commands.py Outdated
@sondrebr sondrebr requested a review from trz42 March 16, 2026 15:38
Copy link
Copy Markdown
Contributor

@trz42 trz42 left a comment

Choose a reason for hiding this comment

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

Well done! Thanks a lot for the changes.

@trz42 trz42 merged commit 544d34c into EESSI:develop Mar 17, 2026
7 checks passed
@boegel
Copy link
Copy Markdown
Contributor

boegel commented Mar 17, 2026

+1, thanks a lot for all this effort @sondrebr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants