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

Shindo to Minitest: orchestration, metering, volume #134

Merged
merged 1 commit into from Jun 29, 2016
Merged

Shindo to Minitest: orchestration, metering, volume #134

merged 1 commit into from Jun 29, 2016

Conversation

gildub
Copy link
Collaborator

@gildub gildub commented May 25, 2016

Migrates metering, orchestration and volume

Note: This is not using subfolder 'openstack' anymore

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Changes Unknown when pulling fb3f2f3 on gildub:shindo_to_minitest-orchestr-meter-vol into * on fog:master*.

@gildub gildub added ready and removed in progress labels May 27, 2016
@quota.must_match_schema(@quota_set_format)
end

it "updates quota" do
Copy link
Contributor

Choose a reason for hiding this comment

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

This test has two asserts - line 33 and line 37. When first one fails the second one will never be run (and it can fail too). This introduces delay in developers workflow - solve the first one failing just to discover the second one failing too.

Another issue with more than one assert per it is connected to what I wrote at #128 (comment) - it is the structure of describe/it and naming of them. Should one of these asserts fail I will see
Fog::Volume[:openstack] | quota requests::success#test_0003_updates quota [/home/pblaho/workspace/fog/fog-openstack/test/requests/volume/quota_tests.rb:37]: and with information about expected and actual result. That line suggests where the failing assert is located (line 37 here) but it tells me that it is Fog::Volume[:openstack] | quota requests::success#test_0003_updates quota test failing.

With proper naming and structure of describe/it blocks and only one assert per test you can immediately see all failed tests and exactly what test failed and developer who knows the codebase can just know what the issue could be.

If there is a need to test two subsequent quota updates I would just create two it blocks, make them share the same describe and before block to setup tests, and the first would just call #update_quota once and assert result and the second would call it twice and assert result.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the detailed explanation. I agree the break down of describe/it can/must be improved for better readability. Again this is legacy code and the initial target is to port it to Minitest.
Regarding the specific "updates quota" I effectively don't see the point of asserting #update_quota twice. Therefore I remove the second one.

@petrblaho
Copy link
Contributor

If we can solve two asserts in one it I am happy to say that LGTM.

@gildub gildub changed the title Shindo to Minitest: metering, orchestration, volume Shindo to Minitest: orchestration, metering, volume May 30, 2016
@coveralls
Copy link

coveralls commented May 30, 2016

Coverage Status

Changes Unknown when pulling f0027cb on gildub:shindo_to_minitest-orchestr-meter-vol into * on fog:master*.

Migrates metering, orchestration and volume

Note: This is not using subfolder 'openstack' anymore
@coveralls
Copy link

coveralls commented Jun 6, 2016

Coverage Status

Changes Unknown when pulling e2e0c8c on gildub:shindo_to_minitest-orchestr-meter-vol into * on fog:master*.

@dhague dhague merged commit 4ac25c6 into fog:master Jun 29, 2016
@mdarby mdarby removed the ready label Jun 29, 2016
@gildub gildub deleted the shindo_to_minitest-orchestr-meter-vol branch September 29, 2016 06:33
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.

None yet

5 participants