Specifying an input file from a different directory within CLI's 'opa test' #211
Unanswered
stevend-15
asked this question in
OPA and Rego
Replies: 1 comment 2 replies
-
Hi Steven! The package test.fixtures
test_object := {
"attributes": "here",
"more": "here",
"...", "..."
} package test
import data.test.fixtures
test_something {
allow with input as fixtures.test_object
} If you are looking at testing large sets of data, perhaps conftest would be a good option? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am new to opa/rego and have an opa test that I would like to run. Within that test .rego file, I would like to use an input.json file from a different directory. Is there a way to specify that file within a "with input as _____" statement within the test file? i.e.
My thoughts so far have lead me to trying the -b option but the directories are pretty far apart and I do not want a bundle that large and dependent. Additionally, I have thought about the import statements but I do not have the "-i" option within the opa test subcommand. I've also tried specifying each file (the .rego policy file, the .rego test file, and an input file) within the opa test subcommand to no avail.
Any help is greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions