Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: Fix opa test --ignore when used together with --bundle #6185

Merged

Conversation

joaobrandt
Copy link
Contributor

Why the changes in this PR are needed?

When used opa test --bundle the flags --ignore were not used to filter the files.

What are the changes in this PR?

Change the function LoadBundles to use the parameter filter received.

Notes to assist PR review:

None.

Further comments:

None.

When using the --bundle flag, the opa test was ignoring (pun intented)
the --ignore flags.

Signed-off-by: João Paulo G. Brandt <joao@miro.com>
@joaobrandt
Copy link
Contributor Author

Linux test jobs are failing with the cause:

FAIL: TestRego/regression/dynamic_object_to_static_object_comparison

Are this related with the change?

@ashutosh-narkar
Copy link
Member

Are this related with the change?

@joaobrandt this is un-related to your change.

@@ -621,6 +621,7 @@ func LoadBundles(args []string, filter loader.Filter) (map[string]*bundle.Bundle
b, err := loader.NewFileLoader().
WithProcessAnnotation(true).
WithSkipBundleVerification(true).
WithFilter(filter).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @joaobrandt!

@ashutosh-narkar ashutosh-narkar merged commit 7bf2075 into open-policy-agent:main Aug 28, 2023
23 of 25 checks passed
@joaobrandt joaobrandt deleted the fix-test-bundle-ignore branch August 29, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants