Skip to content

Learning Rego - Confusion regarding input behavior when writing unit tests #463

Discussion options

You must be logged in to vote

Hi @mooneeb , replicating your setup, but cleaning up the input to valid json

{
    "Internal_deployment": {
        "Deployment": { 
        },
        "public_registry_urls": ["false"]
    }
}

I get:

$ opa test . -v
FAILURES
--------------------------------------------------------------------------------
data.policy.special.test_resources_found: FAIL (2.360375ms)

  query:1                                 Enter data.policy.special.test_resources_found = _
  sources/policy_detector_test.rego:5     | Enter data.policy.special.test_resources_found
  sources/policy_detector.rego:28         | | Enter data.policy.special.found
  sources/policy_detector.rego:28         | | | Fail gt(__local13_…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mooneeb
Comment options

@johanfylling
Comment options

@mooneeb
Comment options

@johanfylling
Comment options

Answer selected by mooneeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants