8000 Various test related improvements; no functional change by maruel · Pull Request #111 · dnaeon/go-vcr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Various test related improvements; no functional change #111

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

Merged
merged 1 commit into from
Mar 23, 2025

Conversation

maruel
Copy link
Contributor
@maruel maruel commented Mar 21, 2025
  • Use testdata/ instead of fixtures/. This is customary in Go to use testdata/ for test-only data.
  • Use t.Cleanup() when calling Stop() and verify the returned error.
  • Use https://go.dev/VERSION?m=text instead of https://go.dev/ for a shorter response.
  • Show how to use the test's name as the test file name.
  • Add missing err check in json_test.go.
  • Add an example to record that shows up in the documentation.

Test-only and documentation-only change.

Tested with:

go test -cover ./...

go install golang.org/x/pkgsite/cmd/pkgsite@latest
pkgsite -http=:6060

Fixes #109

- Use testdata/ instead of fixtures/. This is customary in Go to use
  testdata/ for test-only data.
- Use t.Cleanup() when calling Stop() and verify the returned error.
- Use https://go.dev/VERSION?m=text instead of https://go.dev/ for a
  shorter response.
- Show how to use the test's name as the test file name.
- Add missing err check in json_test.go.
- Add an example to record that shows up in the documentation.

Test-only and documentation-only change.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.92%. Comparing base (e354a4d) to head (04840f6).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##               v4     #111   +/-   ##
=======================================
  Coverage   50.92%   50.92%           
=======================================
  Files           4        4           
  Lines         646      646           
=======================================
  Hits          329      329           
  Misses        297      297           
  Partials       20       20           

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

@pkieltyka
Copy link

nice work :)

@dnaeon
Copy link
Owner
dnaeon commented Mar 23, 2025

nice work :)

Agree! Thanks, @maruel ! :)

@dnaeon dnaeon merged commit 307101b into dnaeon:v4 Mar 23, 2025
2 checks passed
@maruel maruel deleted the testdata branch March 24, 2025 23:26
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.

Recommend using testdata instead of fixtures as the recording directory
4 participants
0