-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added unit tests for ClusterRequirer interface class #107
Conversation
I forgot to run the linter before committing, I have already fixed everything locally and will push the changes together with the fixes from the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the issues I commented about, if I understand these tests correctly, you might have just found a bug.
I'm not sure why there should be a behavioural difference between 'invalid local app data' and 'invalid local unit data' when it comes to emitting 'cluster removed' events.
Could you mash those two tests into one, parametrize it with an app
boolean field, depending on which value you choose what to patch and adapt your assertion?
And make a note that the assertion special-casing should not be necessary.
@lucabello do you agree that this is an issue?
Note for @lorenzo-medici: it will be out of scope for you and this PR to fix the bug, I'm just wondering if we should be opening a new one to track or not.
I merged the two unit tests into one with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one final nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better! last pass :)
Is this failure my fault? All tests pass locally, and the failure point in the GH workflow is
which I don't know how to fix as |
No that's a recent change in cos-lib, it could be that the tempo coordinator's integration tests are broken because of it. |
Issue
Missing test coverage for
src/coordinated_workers/interface.py
in classClusterRequirer
Solution
Create additional tests with invalid databags, specifically when the cluster relation changes
Context
The ClusterProvider object is a relation endpoint wrapper for the 'cluster' relation interface.
That piece of code is responsible for walking through all units related over 'cluster' and collect a piece of data from their databags.
Testing Instructions
Run
tox -e unit
Upgrade Notes
No code changes, only effect is increased test coverage.