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

Implement a mock client #146

Closed
hectorj2f opened this issue Nov 14, 2022 · 4 comments · Fixed by #175
Closed

Implement a mock client #146

hectorj2f opened this issue Nov 14, 2022 · 4 comments · Fixed by #175
Assignees
Labels
enhancement New feature or request

Comments

@hectorj2f
Copy link
Contributor

Description

We need to create a mock client where all the different API calls are supported and these functions return valid data for testing purposes.

@hectorj2f hectorj2f added the enhancement New feature or request label Nov 14, 2022
@haydentherapper
Copy link
Contributor

This would be useful! FWIW, it's easy to spin up a local test server currently in unit testing, it's just more heavyweight.

@hectorj2f
Copy link
Contributor Author

Yes, that is what I'd like to avoid with this mock client.

@haydentherapper
Copy link
Contributor

We can probably start with having the client just replay a static certificate chain and response from a test instance. A mock client could also take in a signing key and chain and run parts of https://github.com/sigstore/timestamp-authority/blob/main/pkg/api/timestamp.go#L29

@haydentherapper
Copy link
Contributor

Working on this

@haydentherapper haydentherapper self-assigned this Dec 8, 2022
haydentherapper added a commit that referenced this issue Dec 8, 2022
This can be used to avoid spinning up server instances when running unit
tests. This supports generation via request and via options.

Fixes #146

Signed-off-by: Hayden Blauzvern <[email protected]>
haydentherapper added a commit that referenced this issue Dec 9, 2022
This can be used to avoid spinning up server instances when running unit
tests. This supports generation via request and via options.

Fixes #146

Signed-off-by: Hayden Blauzvern <[email protected]>

Signed-off-by: Hayden Blauzvern <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants