Skip to content

Add support for blockstorage volume_type quota#2109

Merged
jtopjian merged 1 commit intogophercloud:masterfrom
nikParasyr:volume_type_quota
Feb 5, 2021
Merged

Add support for blockstorage volume_type quota#2109
jtopjian merged 1 commit intogophercloud:masterfrom
nikParasyr:volume_type_quota

Conversation

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 1, 2021

Coverage Status

Coverage decreased (-0.008%) to 79.831% when pulling 41a444f on nikParasyr:volume_type_quota into 633d735 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 1, 2021

Build failed.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 1, 2021

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 1, 2021

Build failed.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 2, 2021

@nikParasyr Thanks for working on this. I haven't looked it over since it's still a draft, but wanted to mention that the acceptance test failure is an actual failure. You can see details about the failure by clicking on the gophercloud-acceptance-test link above, and then going to the job-output.txt.gz file and searching for:

--- FAIL: TestQuotasetUpdate

Let me know if you have any questions or need any help. One common issue seen is that people will test on their own local OpenStack deployment which might act differently than a "vanilla" devstack environment. If this is your situation, it might be helpful to launch a vm, install devstack and go and work on the test from within that environment.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

nikParasyr commented Feb 2, 2021

Hello @jtopjian. Thank you for your input. I'd like some more input and help if possible. The acceptance test fails for 2 reasons. I was aware of both of them from running it locally but i wanted to see the openlab result as well as get an opinion.

  • Currently I have updated TestQuotasetUpdate to create a volume type foo in order to test that the patch works as intended. That isn't rly workable though because Extra is populated by volumes_/snapshots_/gigabytes_<volume_type_name> for every volumeType that exists on the testing cloud. So it doesn't only contain for the foo volume type but also for all existing volumeTypes. The volumeTypes differ from cloud to cloud. So hardcoding the expected Extra map won't work. Therefore to be able to test this properly we probably need to create Extra dynamically based on the existing volumeTypes found. That will sort of increase the complexity of the acceptance test but it's the only way i can think of to make it run properly on any testing cloud. Let me know if i should work towards that direction.
  • Secondly, even when i hardcoded the Extra based on my testing cloud volume types I still get the following error which I'm a bit unsure how to handle. Same error occurs on openlab. It's a type error. Even more "weird" is that between runs I get different results. One run only gigabytes_foo is complaining, then all of them, then only volumes_foo etc. I'm probably missing something very basic here...
	=== RUN   TestQuotasetUpdate
	TestQuotasetUpdate: convenience.go:236: Failure in quotaset_test.go, line 122:at .Extra[gigabytes_foo] expected 100, but got 100
	TestQuotasetUpdate: convenience.go:236: Failure in quotaset_test.go, line 122:at .Extra[volumes_foo] expected 10, but got 10
	TestQuotasetUpdate: convenience.go:236: Failure in quotaset_test.go, line 122:at .Extra[snapshots_foo] expected 10, but got 10
	TestQuotasetUpdate: convenience.go:236: Failure in quotaset_test.go, line 122:at .Extra expected <nil>, but got map[string]interface {}{"gigabytes_foo":100, "snapshots_foo":10, "volumes_foo":10}
	TestQuotasetUpdate: convenience.go:35: Failure in quotaset_test.go, line 122: The structures were different.
	--- FAIL: TestQuotasetUpdate (0.88s)
	FAIL

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 3, 2021

Currently I have updated TestQuotasetUpdate to create a volume type foo in order to test that the patch works as intended. That isn't rly workable though because Extra is populated by volumes_/snapshots_/gigabytes_<volume_type_name> for every volumeType that exists on the testing cloud.

This is OK. Take a look at the other acceptance tests for different examples. A lot of them contain a pattern that defines a variable called found and then only checks for a specific resource, ignoring other resources. This is to account for existing resources in the cloud.

Secondly, even when i hardcoded the Extra based on my testing cloud volume types I still get the following error which I'm a bit unsure how to handle.

At first glance, this looks like some kind of type assertion issue. I would double-check the type that is being marshaled into "Extra" and make sure it's being compared to a type of the same kind.

I hope this helps, but let me know if you need more details.

@nikParasyr nikParasyr marked this pull request as ready for review February 3, 2021 12:40
@nikParasyr
Copy link
Copy Markdown
Contributor Author

@jtopjian Thanks for all the help. This is ready for a first review.
Tried to follow the contributing guide as much as possible but I might have missed some spots.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2021

Build failed.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2021

Build failed.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2021

Build failed.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2021

Build failed.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 3, 2021

@nikParasyr There might be an issue with OpenLab. I recommend trying again in a few hours. I'll try to get some time to review this either today or tomorrow.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2021

Build failed.


// Collect other fields and bundle them into Extra
// but only if a field titled "extra" wasn't sent.
if s.Extra != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is specific to the Keystone/Identity API and can be removed here. The body of the else clause should only be used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 4, 2021

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 4, 2021

Build failed.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 4, 2021

Build failed.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

hmmmm openlab is consistently failing. maybe this is related? not the occm stuff but openlab upgrading to focal? ill stop rechecking for the time being

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 5, 2021

Yes, it's possible. I've subscribed to the issue and will keep an eye on it.

In the meantime, I have run the tests in my own devstack environment and everything looks good to me. If you're finished with this, I can go ahead and merge it.

@nikParasyr
Copy link
Copy Markdown
Contributor Author

Yes. I've finished with this one. Thank you for all the help :)

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

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

LGTM - thank you!

@jtopjian jtopjian merged commit 281f27b into gophercloud:master Feb 5, 2021
@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 5, 2021

@nikParasyr Thank you for submitting this - this was really good work.

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