-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a test for the doc-generator #10
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.
can you also add a test for the metrics building with a custom template? you can create a simple template with some unique strings, and check they appear in the output
feaa413
to
8494136
Compare
@machadovilaca Fixed your comment, WDYT? |
8494136
to
4c9693a
Compare
Signed-off-by: avlitman <alitman@redhat.com>
4c9693a
to
5cdeaf3
Compare
It("Checks that the metrics doc is sorted by metrics and recording rules name", func() { | ||
templateDocMetrics := BuildMetricsDocsWithCustomTemplate(metrics, recordingRules, tpl) | ||
indexOfA := strings.Index(templateDocMetrics, "AExampleRecordingRule") | ||
indexOfB := strings.Index(templateDocMetrics, "BExampleGauge") | ||
indexOfC := strings.Index(templateDocMetrics, "CExampleRecordingRule") | ||
indexOfD := strings.Index(templateDocMetrics, "DExampleCounterVec") | ||
|
||
Expect(indexOfA).To(BeNumerically("<", indexOfB)) | ||
Expect(indexOfB).To(BeNumerically("<", indexOfC)) | ||
Expect(indexOfC).To(BeNumerically("<", indexOfD)) | ||
}) |
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.
👌
Add a test to verify the doc generator adding metrics and recording rules.