Skip to content

Conversation

@henripqt
Copy link
Contributor

@henripqt henripqt commented Feb 3, 2026

WHAT :

As mentioned some time ago in this PR #131 using an httptest.Server gives allows us to tests against real world scenarios.
I've mentioned back then that If you'd like I'd be happy to make another PR in order to adjust the tests accordingly, and, even though it took me some time to get back to it due to personal reason here I am as promised.

The following changes introduce a test bed in order to simplify the tests setup and avoid redundant operations and each tests have been adjusted to make use of this new test bed.

The validate response has been updated to actually reflect the real world scenario where http body is equal to http.NoBody as having a nil body is actually something that can't happen.

If you are satisfy with this PR I'll adjust the other tests to reflect this pattern

NOTE :

Following some CI failures regarding linting I took the liberty to add a pre-commit check that'll run golangci-lint locally using go tool command that way we ensure we don't waste any CI resource (at least for the ones who install the hooks)

@henripqt henripqt changed the title $Chore revamp validate response tests chore: revamp validate response tests Feb 3, 2026
@henripqt henripqt force-pushed the chore-revamp-validate-response-tests branch from 35ad150 to 811626a Compare February 3, 2026 12:31
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.60%. Comparing base (85b4a06) to head (4e78b20).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   97.62%   97.60%   -0.02%     
==========================================
  Files          56       56              
  Lines        5256     5256              
==========================================
- Hits         5131     5130       -1     
- Misses        125      126       +1     
Flag Coverage Δ
unittests 97.60% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant