-
Notifications
You must be signed in to change notification settings - Fork 56
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
cargo: update prometheus to 0.7 #125
Conversation
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'd feel more comfortable stamping this if we had metrics tests. Do you have time to work on that within the scope of this PR?
quay/Cargo.toml
Outdated
@@ -18,4 +18,4 @@ tokio = "^0.1.14" | |||
|
|||
[features] | |||
test-net = [] | |||
test-net-private = [] |
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.
this change seems unrelated
@steveej I think so, but a complete metrics test would require an integration suite. Would a "the metrics handler returns 200 and a non-empty body" test be enough here (maybe with some keyword grepping too)? |
I'm fine with that for this PR 👍 |
@steveej this now comes with tests too, PTAL. |
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 haven't fully gone through here but my general suggestion for all tests is that we use Result
like in regular code.
@steveej I've updated to use |
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.
except for the duplicate common_init
* method this looks pretty good, thanks for the tests!
* I went back and forth two twice and they looked the same
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.
Since you're using failure
in here you can use the ensure!()
macro here and elsewhere instead of assert!()
.
assert!(resp.body().is_binary()); | ||
|
||
if let actix_web::Body::Binary(body) = resp.body() { | ||
assert!(!body.is_empty()); |
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.
Since you're using failure
in here you can use the ensure!()
macro here and elsewhere instead of assert!()
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.
assert
and ensure
are not directly interchangeable, as the latter doesn't have fileline information and additional introspection details provided by the former.
I'm sticking to assert
for enforcing invariants, but feel free to have a spike ticket to investigate/build a blended ensure
+assert_*
macro.
This updates prometheus library to latest version.
This adds a simple test for the metrics handler.
This adds a simple test for the metrics handler.
I've moved shared testing helpers to |
Thanks for walking the extra mile! 🏃♂️ /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lucab, steveeJ The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
This updates prometheus library to latest version.
/cc @steveej