-
Notifications
You must be signed in to change notification settings - Fork 24
Fix error message #1603
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
base: main
Are you sure you want to change the base?
Fix error message #1603
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,6 +423,20 @@ func TestStandardSecrets(t *testing.T) { | |
require.Equal(t, "Bar", result.GetValue().GetStringValue()) | ||
}) | ||
|
||
t.Run("returns an error when there are invalid UTF-8 bytes", func(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests fail because you didn't implement the STD test for common. This version of it verifies the test can pass. Once you have that, I would implement it in Go's SDK too to ensure assumptions you made are correct about messaging (eg the bar question that Street asked below). It sucks, but it keeps us from having a circular dependency. I think of Go as the reference implementation, even though it's not with the host, it's good to ensure it passes. |
||
b := []byte{0xff, 0xfe, 0xfd} // invalid UTF-8 bytes | ||
s := string(b) | ||
|
||
result := runSecretTest(t, m, &sdk.SecretResponse{ | ||
Response: &sdk.SecretResponse_Secret{ | ||
Secret: &sdk.Secret{ | ||
Value: s, | ||
}, | ||
}, | ||
}) | ||
require.Equal(t, "Bar", result.GetValue().GetStringValue(), result.GetError()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe missing some parent test context, but where does the value "Bar" come from if this is expected to error? |
||
}) | ||
|
||
t.Run("returns an error if the secret doesn't exist", func(t *testing.T) { | ||
resp := runSecretTest(t, m, &sdk.SecretResponse{ | ||
Response: &sdk.SecretResponse_Error{ | ||
|
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.
Can you also add one that shows the SDK returns the right error from the host?