oxidecomputer / oxidecomputer/dropshot

Proposal: make_request helpers shouldn't assert status code

Open
#165 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

It confuses me every time that a helper called make_request_with_body takes a status code and asserts the response has it. I would much rather see explicit asserts in the calling test code. The main problem I see with making this change is that if you take out an assert, callers are required to add in the assert in their test code, otherwise any existing tests will continue to silently pass even if they're not supposed to.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the make_request_with_body helper and every caller that passes a status code. Move the status assertions into the calling tests, ensuring each existing test still explicitly checks the expected response. Done means the helper no longer asserts status codes and the test suite retains equivalent coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.