-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: test hook error handling #202
Conversation
e2751aa
to
8b04a3d
Compare
8b04a3d
to
038084f
Compare
1bc25e3
to
2577036
Compare
@@ -78,3 +84,28 @@ func (h *Hooks) ExpectCall(t *ldtest.T, hookName string, | |||
} | |||
} | |||
} | |||
|
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.
This is a somewhat janky expectation method. But, we couldn't quite think of what we'd want to see if this was more generic.
So, I think we should feel free to refactor or replace this when the time comes. Or now, if there's a better idea.
I approve, but since we paired on this and others have started reviewing, I will not officially approve to give other reviewers an opportunity before it merges. |
🤖 I have created a release *beep* *boop* --- ## [2.10.0](v2.9.0...v2.10.0) (2024-04-03) ### Features * test hook error handling ([#202](#202)) ([256ae92](256ae92)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This introduces a test that the SDK can successfully recover from a hook stage returning an error or throwing an exception. It runs under existing capability
evaluation-hooks
.This introduces a new
errors
object on the Hooks service definition which SDKs must inspect. It contains an error message that should be thrown/returned from a specific stage.I've only written one test here, which is that:
beforeEvaluation
stage, ensure theafterEvaluation
stage still runs.Existing SDKs are expected to fail this test until implemented. I thought about having it as a new capability, but it is part of the base spec and the reminder (seeing the test fail) should be helpful.