Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add unit tests for slurm_ops #3

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

jedel1043
Copy link
Contributor

A bit of magic on the test file to avoid having to repeat 4 times the exact same test code, but I think we can live with that 😬

It's a bit more explanatory about what the method does.
@NucciTheBoss NucciTheBoss self-requested a review July 2, 2024 20:36
@NucciTheBoss NucciTheBoss added the enhancement New feature or request label Jul 2, 2024
Copy link
Member

@NucciTheBoss NucciTheBoss left a comment

Choose a reason for hiding this comment

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

Overall, looks great! Just a couple minor comments.

Before we merge, can you also add some coverage for lines 89-92? It's the block for handling if the subprocess invocation in _call fails. Not too difficult to add a side effect for subprocess.check_output(...). I want to have this block covered just so we know that the error is properly bubbled up, and it is nice to have the groundwork laid for testing any advanced error recovery mechanisms we might add. Also, who doesn't love 100% coverage 😜

Let me know if you have any questions!

tests/unit/test_slurm_ops.py Show resolved Hide resolved
tests/unit/test_slurm_ops.py Outdated Show resolved Hide resolved
tests/unit/test_slurm_ops.py Outdated Show resolved Hide resolved
@NucciTheBoss
Copy link
Member

A bit of magic on the test file to avoid having to repeat 4 times the exact same test code, but I think we can live with that 😬

I can live with it 🤣

Copy link
Member

@NucciTheBoss NucciTheBoss left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding that last bit of coverage 😃

tests/unit/test_slurm_ops.py Show resolved Hide resolved
@NucciTheBoss NucciTheBoss merged commit 7aae9a4 into charmed-hpc:main Jul 3, 2024
4 checks passed
@jedel1043 jedel1043 deleted the unit-tests branch July 3, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants