Skip to content

Conversation

@ahl
Copy link
Contributor

@ahl ahl commented Sep 13, 2024

In my misguided effort to migrate us to hyper v1, I stumbled onto a custom hyper server that we use for testing the oximeter consumer. With hyper v1, this code breaks, so we need to do something. My observation is that hyper v1 has made this sort of small server a bigger pain in the neck to write. So if we're going to need to do work, my suggestion is to do less work.

The httpmock crate is pretty ideal for this use case. While we already have httptest in omicron, it doesn't do quite as good of a job here (in particular you say "this mock should be hit N times" whereas this use case wants to say "how many times was this mock hit?"). While I'm a bit reluctant to expand our dependency graph with a second http mocking crate... it's a bit late in the day to fret about the expansiveness of the dependency graph!

@ahl ahl requested a review from bnaecker September 13, 2024 18:31
Copy link
Collaborator

@bnaecker bnaecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome, thanks!

highway = "1.2.0"
hkdf = "0.12.4"
http = "0.2.12"
httpmock = "0.8.0-alpha.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose this version to get familiarity for our use of this crate in oxide.rs

@ahl ahl merged commit d6907fc into main Sep 14, 2024
@ahl ahl deleted the httpmock branch September 14, 2024 03:39
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