Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUnexpected order dependency in promtool test rules unit tests #5049
Comments
This comment has been minimized.
This comment has been minimized.
|
/cc @codesome I don't see https://prometheus.io/docs/prometheus/latest/configuration/unit_testing_rules/#promql_test_case mentioning ordering requirements, so this seems like a bug. |
This comment has been minimized.
This comment has been minimized.
|
Will take a look in couple of days, thanks for reporting @vatine. |
This comment has been minimized.
This comment has been minimized.
|
Yes this is a bug, I think I assumed the order when implementing it. I will open a PR with the fix. |
codesome
referenced this issue
Dec 31, 2018
Merged
Sort samples before comparing - PromQL unit test #5052
brian-brazil
closed this
in
#5052
Dec 31, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vatine commentedDec 28, 2018
Bug Report
What did you do?
Wrote a rule unit-test
What did you expect to see?
The unit-test passing, without having to specify my test cases in any specific order (it looks like the exp_samples need to have the labels in lexicographic order, which is quite unexpected).
What did you see instead? Under which circumstances?
The unit-test pass/fail depends on the ordering of the exp_samples, a minimal test case is attached.
Environment
MacOS and Linux
System information:
insert output of
uname -srmherePrometheus version:
insert output of
prometheus --versionhereAlertmanager version:
insert output of
alertmanager --versionhere (if relevant to the issue)Prometheus configuration file:
Failing unit tests:
Example output:
All this with the official MacOS build, but initially found on Linux.