-
Notifications
You must be signed in to change notification settings - Fork 0
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
integration: properly parse output metrics and assert more things about them #44
base: main
Are you sure you want to change the base?
Conversation
5bb2694
to
70d4eec
Compare
70d4eec
to
80516fc
Compare
f36271d
to
7b04031
Compare
t.Run("metrics", func(t *testing.T) { | ||
for _, tc := range []struct { | ||
name string | ||
script []byte | ||
}{ | ||
{ | ||
name: "singleRequest", | ||
script: scriptSingleRequest, | ||
}, | ||
} { | ||
tc := tc | ||
|
||
t.Run(tc.name, func(t *testing.T) { |
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 used to create two subtests, one for metrics and then one for each script we run. As it turns out, we only test for metrics and we only run that script, so I removed these two subtests entirely and decreased indentation a bunch. Git does not do a good job displaying this indentation change.
Feel free to switch to the single commit view for a less noisy diff.
This PR improves the existing integration test making it more exhaustive.
Previously, the extension output was parsed as text and it was checked as such, which only allowed for few assertions to be made without very complicated code.
This PR imports the Prometheus parser and data models, and parses the output with them. This unblocks more exhaustive assertions, which I also add on this PR.
The main motivation for this PR is to get good coverage to assert that the big refactor in #34 is still conformant with the previous behavior.