You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opa test ... should produce the same output every time it is run if no modules have changed.
Actual Behavior
opa test ... may produce different results from run to run. For example:
. 2019-08-09 12:22:29
. ~/tmp/join
. opa test .
9 errors occurred:
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:111: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:121: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:69: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:79: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:10: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:11: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:11: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:6: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:16: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
. 2019-08-09 12:22:35
. ~/tmp/join
. opa test .
10 errors occurred:
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:111: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:121: rego_type_error: match error
left : string
right : boolean
utils/object/v1/v1.rego:13: rego_type_error: undefined function data.library.v1.utils.object.v1.get
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:79: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:69: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:10: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:11: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:11: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:16: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
utils/object/test_v1/test_v1.rego:6: rego_type_error: undefined function data.library.v1.utils.object.v1.merge
. 2019-08-09 12:22:39
. ~/tmp/join
. opa test .
4 errors occurred:
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:79: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:111: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:121: rego_type_error: match error
left : string
right : boolean
stacks/resolutions/prioritized/allow_then_deny/v1/v1.rego:69: rego_type_error: match error
left : string
right : boolean
. 2019-08-09 12:22:40
. ~/tmp/join
.
Steps to Reproduce the Problem
Run opa test ... more than once with tests/modules that are expected to produce errors
The text was updated successfully, but these errors were encountered:
Previously the type checker would not sort errors before returning
them. As a result, the ordering of errors would depend on the order of
rules passed to the type checker (which is non-deterministic due to Go
map iteration order.)
These changes update the type checker to sort errors by location
before before returning them. This way the errors reported by opa test
and opa check and everything else are consistent across runs.
Fixesopen-policy-agent#1620
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Previously the type checker would not sort errors before returning
them. As a result, the ordering of errors would depend on the order of
rules passed to the type checker (which is non-deterministic due to Go
map iteration order.)
These changes update the type checker to sort errors by location
before before returning them. This way the errors reported by opa test
and opa check and everything else are consistent across runs.
Fixes#1620
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Expected Behavior
opa test ...
should produce the same output every time it is run if no modules have changed.Actual Behavior
opa test ...
may produce different results from run to run. For example:Steps to Reproduce the Problem
opa test ...
more than once with tests/modules that are expected to produce errorsThe text was updated successfully, but these errors were encountered: