-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
sdk_test: add environment variable tests #6420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! Just one nitpick re: os.Setenv vs t.SetEnv
sdk/opa_test.go
Outdated
@@ -2150,6 +2151,150 @@ result := { | |||
} | |||
} | |||
|
|||
func TestOpaRuntimeEnvironmentVariableDefinedInOS(t *testing.T) { | |||
os.Setenv("TOKEN_VERIFY_KEY", "B41BD5F462719C6D6118E673A2389") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Let's use t.SetEnv
I updated the commit on my forked branch expecting it to update the PR, but it doesn't look like it did. Is there something else that I need to do for the PR to be updated? |
I think I was looking at an outdated compare. I think it looks correct now. |
sdk/opa_test.go
Outdated
defer server.Stop() | ||
|
||
testBundleResource := "/bundles/bundle.tar.gz" | ||
testLabel := "a label" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the label relevant to the test? I'd suggest removing it if not... 🤔 Sorry I didn't notice in the last round of reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not relevant. I removed it from both tests and updated the PR. Thanks!
Add two environment variable tests which illustrate how an environment variable can be used in OPA to verify a JWT. Signed-off-by: Robert Hafner <[email protected]>
Add two environment variable tests which illustrate how an environment variable can be used in OPA to verify a JWT. Signed-off-by: Robert Hafner <[email protected]> Signed-off-by: Colin Lacy <[email protected]>
Add two environment variable tests which illustrate how an environment variable can be used in OPA to verify a JWT. Signed-off-by: Robert Hafner <[email protected]>
Add two environment variable tests which illustrate how an environment variable can be used in OPA to verify a JWT.
Why the changes in this PR are needed?
What are the changes in this PR?
Notes to assist PR review:
Further comments: