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

feat: Add hooks contract tests. #200

Merged
merged 11 commits into from
Mar 22, 2024
Merged

Conversation

kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Mar 14, 2024

This PR adds support for basic contract testing of hooks.

It does not include support for dynamic registration of hooks.
It does not yet test hook execution order.
It does not test hooks throwing errors.

@kinyoklion kinyoklion force-pushed the rlamb/add-hooks-contract-tests branch from ddfde24 to 9211849 Compare March 14, 2024 23:30
@kinyoklion kinyoklion marked this pull request as ready for review March 15, 2024 16:47
@kinyoklion kinyoklion requested a review from a team March 15, 2024 16:47
sdktests/server_side_hooks.go Outdated Show resolved Hide resolved
sdktests/testapi_hooks.go Outdated Show resolved Hide resolved
@cwaldren-ld
Copy link
Contributor

Curious why the change to the non-blocking push? I'm guessing it was forcing the SDK to be synchronized with whatever test code expectations had (or had not) been written?

@kinyoklion
Copy link
Member Author

Curious why the change to the non-blocking push? I'm guessing it was forcing the SDK to be synchronized with whatever test code expectations had (or had not) been written?

The node SDK doesn't have a way to do a synchronous http request. So it fires and forgets the request and the tests passed. Because the evaluation continues.
Ruby can send it synchronously, but that blocks the evaluation (waiting for the test to accept the payload), so an evaluation call never completes.

docs/service_spec.md Outdated Show resolved Hide resolved
docs/service_spec.md Outdated Show resolved Hide resolved
kinyoklion and others added 2 commits March 21, 2024 13:07
Co-authored-by: Casey Waldren <[email protected]>
Co-authored-by: Casey Waldren <[email protected]>
@cwaldren-ld
Copy link
Contributor

cwaldren-ld commented Mar 21, 2024

TODO: change 0xDEADBEEF to something that fits into a signed int

Edit: TODONE.

@cwaldren-ld
Copy link
Contributor

Alright, .NET server is now passing all contract tests.

@kinyoklion kinyoklion merged commit 53331bb into v2 Mar 22, 2024
2 checks passed
@kinyoklion kinyoklion deleted the rlamb/add-hooks-contract-tests branch March 22, 2024 19:27
cwaldren-ld pushed a commit that referenced this pull request Apr 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.9.0](v2.8.3...v2.9.0)
(2024-03-22)


### Features

* Add hooks contract tests.
([#200](#200))
([53331bb](53331bb))

---
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>
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.

3 participants