-
Notifications
You must be signed in to change notification settings - Fork 4
Fundamental test coverage of vgrid module reusing existing structure. #371
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
base: next
Are you sure you want to change the base?
Conversation
…. Extended test coverage to more functions.
| self.test_vgrid, 'owners', self.configuration) | ||
| self.assertEqual(owners, [owner1]) | ||
|
|
||
| # Test 2: Prepend new owner |
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.
When we have a situation where a single test function is actually testing multiple things like this to me that's a hint to each of these ought to be their own test function.
Moreover, there seem to be two different "starting" states for these tests - there is a "with no existing vgrid" and "with an existing vgrid", and likely different needs in terms of setup code for them. With a lens like that, it suggests two test case blocks:
class TestCase_no_vgrid:
pass
class TestCase_with_existing_vgrid:
pass
with the tests shared between the two, and ech of the "Test 1, Test 2, ..." things in here being much more naturally separate functions in the latter testcase. Note you get one other benefit: you can then tailor before_each to both of the situations. In the "with existing vgrid" case you can place the setup code for provisioning a vgrid in before_each and then that details doesn't need to exist in each test function.
albu-diku
left a comment
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.
I think this is a very important area to cover and it will be a boon to have coverage of this in tree.
I've left a comment with suggestions about how I think the tests could be restructured a little for what I think will be a big aid to comprehensibility here: https://github.com/ucphhpc/migrid-sync/pull/371/files#r2472789903. I'm not going to insist hence delivery as a comment rather than requesting changes, but I do feel it worthwhile if possible.
Fundamental test coverage of
vgridmodule reusing existing structure.Some tests are disabled on purpose because changes are needed in the tested module. Marked as follow-up.