Commit graph

7 commits

Author SHA1 Message Date
David Symonds 7a60e22c2d cmd/promtool: resolve relative paths in alert test files (#5336)
Like `promtool check config <path/to/foo.yaml>`, which resolves relative
paths inside foo.yaml to be relative to `path/to`, this now makes
`promtool test rules <path/to/test.yaml>` do the same thing.

Signed-off-by: David Symonds <dsymonds@gmail.com>
2019-03-27 10:27:26 +01:00
Tariq Ibrahim 8fdfa8abea refine error handling in prometheus (#5388)
i) Uses the more idiomatic Wrap and Wrapf methods for creating nested errors.
ii) Fixes some incorrect usages of fmt.Errorf where the error messages don't have any formatting directives.
iii) Does away with the use of fmt package for errors in favour of pkg/errors

Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-26 00:01:12 +01:00
Simon Pasquier f678e27eb6
*: use latest release of staticcheck (#5057)
* *: use latest release of staticcheck

It also fixes a couple of things in the code flagged by the additional
checks.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Use official release of staticcheck

Also run 'go list' before staticcheck to avoid failures when downloading packages.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-01-04 14:47:38 +01:00
Ganesh Vernekar 7d30ccd0eb Sort samples before comparing - PromQL unit test (#5052)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2018-12-31 10:55:49 +00:00
Ganesh Vernekar fbadd88ba5 Get unique eval times for alert unit tests (#4964)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2018-12-18 08:40:03 +00:00
Ganesh Vernekar cfb3769274 Lazily load samples for unit testing (#4851)
* Lazily load samples for unit testing

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* cleanup

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2018-11-22 14:21:38 +05:30
Ganesh Vernekar 5790d23fd8 Unit testing for rules (#4350)
* Unit testing for rules
* Specifying order of group evaluation in unit tests

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2018-09-25 17:06:26 +01:00