Skip to content

refactor: don't return error from opaTest #7560

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

Merged
merged 2 commits into from
May 19, 2025

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented May 9, 2025

The error is ignored when executed by cobra and the errors are only printed to testParams.errOutput. The returned error was being used in the tests but I updated those to use the error code instead.

Also cleaned up all the formatting issues found in test.go and test_test.go.

the error is ignored and only printed to `testParams.errOutput`

Signed-off-by: sspaink <sspaink@styra.com>
Copy link

netlify bot commented May 9, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit bc77c41
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/682b64652b1f4e0008d1fd76
😎 Deploy Preview https://deploy-preview-7560--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@johanfylling johanfylling left a comment

Choose a reason for hiding this comment

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

LGTM 👍

err := f.Close()
if err != nil {
t.Fatal(err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We do this often enough that it almost warrants a helper function.

@sspaink sspaink merged commit dc1855d into open-policy-agent:main May 19, 2025
28 checks passed
aromeyer pushed a commit to aromeyer/opa that referenced this pull request May 21, 2025
Signed-off-by: sspaink <sspaink@styra.com>
Signed-off-by: aromeyer <alain.romeyer@gmail.com>
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.

2 participants