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

Improve testing and add ip_version to availabilities #77

Merged
merged 2 commits into from
Jan 16, 2020

Conversation

mnaser
Copy link
Contributor

@mnaser mnaser commented Jan 11, 2020

This change improves the testing for the exporter, now testing actual values! It also fixes a few missing mocks and makes the test fail if there is any missing mocks.

It also adds ip_version which is really useful for checking for IP availability.

@mnaser mnaser changed the title This adds a version option and also corrects the promu golang version, as we've been shipping with golang 1.13 Improve testing and add ip_version to availabilities Jan 11, 2020
This patch greatly simplifies the unit testing by using tools
provided by the testutils package from Prometheus and a simple
way to define expected values.

It also adds all the values based on the current mocks, implements
a few missing ones and makes the test suite fail if it hits an
endpoint that is not mocked.

It also took care of a few limit and missing mocks which were
not being properly and fully tested.
When trying to alert and check if you have IPs available, you need
to be able to group by the IP version because if you have both an
IPv4 and IPv6 subnet, you could be running out of IPv4 addresess
in a network but have plenty of IPv6 left.

This patch adds it and updates the appropriate tests.
@niedbalski niedbalski added the enhancement New feature or request label Jan 16, 2020
@niedbalski niedbalski added this to the 1.0.0 milestone Jan 16, 2020
@niedbalski niedbalski merged commit ecad378 into openstack-exporter:master Jan 16, 2020
@niedbalski
Copy link
Member

The code looks good to me, I think is genuinely an awesome improvement to the test suite for making testing a lot easier.

Thank you @mnaser for this amazing contribution.

niedbalski added a commit that referenced this pull request Mar 27, 2020
Fixes and PR(s) merged.

f1b6596 Fix a bug can cause duplicate metrics and improve the implementation (#93)
a96e106 Add disabled reason label for Nova and Cinder (#91)
bd991bc Add cinder capacity metrics (#89)
f611a68 fix failed tests by adding tenant_id (#94)
c99b822 Added label tenant_id to limits_vcpus_max, limits_vcpus_used, limits_memory_max, limits_memory_used (#92)
767d43f Add log level flag (#90)
9282693 Added check on FIPs associated but not active (#85)
d431ae6 Loadbalancer (#81)
f3c8143 New Neutron metrics + inconsistency checks (#82)
ecad378 Improve testing and add ip_version to availabilities (#77)

Signed-off-by: Jorge Niedbalski <[email protected]>
niedbalski added a commit that referenced this pull request Mar 27, 2020
Fixes and PR(s) merged.

f1b6596 Fix a bug can cause duplicate metrics and improve the implementation (#93)
a96e106 Add disabled reason label for Nova and Cinder (#91)
bd991bc Add cinder capacity metrics (#89)
f611a68 fix failed tests by adding tenant_id (#94)
c99b822 Added label tenant_id to limits_vcpus_max, limits_vcpus_used, limits_memory_max, limits_memory_used (#92)
767d43f Add log level flag (#90)
9282693 Added check on FIPs associated but not active (#85)
d431ae6 Loadbalancer (#81)
f3c8143 New Neutron metrics + inconsistency checks (#82)
ecad378 Improve testing and add ip_version to availabilities (#77)

Signed-off-by: Jorge Niedbalski <[email protected]>
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.

None yet

2 participants