Skip to content

Conversation

@Justintime50
Copy link
Member

@Justintime50 Justintime50 commented Nov 18, 2025

Description

Go reeeeally wants tests to live alongside its source code (boo), and to this point, we've separated tests to their own dir and generated coverage with some workarounds but those no longer work in recent versions of Go.

This PR:

  1. Moves everything from tests to the root
  2. Updates all easypost. references to be removed since it's now in the local root project (throughout test files)
  3. Removes the inline code for checking coverage (bootstrap_test.go). This is because we cannot check the statement coverage until after the tests end and thus cannot check in code
  4. Moves that logic to the Makefile since we need to parse the CLI output (Gos tooling is quite poor here) (Makefile)
  5. Updates the fixtures path since tests are no longer nested (fixture_test.go)

Testing

Coverage now reliably shows the statement coverage (before it was always 5% lower than actuality and would be variable), the HTML report also properly shows what's covered in each file where before it didn't.

I tested raising the coverage threshold and it "failed" with the proper error message and then I put it where we actually want it and coverage succeeded.

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc.)

@Justintime50 Justintime50 requested review from a team as code owners November 18, 2025 22:12
@Justintime50 Justintime50 merged commit 8305aa8 into master Nov 18, 2025
15 checks passed
@Justintime50 Justintime50 deleted the fix_coverage_layout branch November 18, 2025 23:08
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