Skip to content
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

Improve testing helper functions #77

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

erka
Copy link
Contributor

@erka erka commented Dec 4, 2024

  • Switch to using testing.TB interface instead of *testing.T.
  • Add t.Helper() to helper functions to ensure failure reports point to
    correct test lines.
  • Use the standard t.TempDir() for a temporary folder creation.
  • Ensure errors are checked when starting the test server.

- Switch to using testing.TB interface instead of *testing.T.
- Add t.Helper() to helper functions to ensure failure reports point to
  correct test lines.
- Use the standard t.TempDir() for a temporary folder creation.
- Ensure errors are checked when starting the test server.
Copy link
Collaborator

@kevinmcconnell kevinmcconnell left a comment

Choose a reason for hiding this comment

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

Thanks @erka, that's great!

FWIW, the shortTmpDir helper existed due to some test failures that happened whenever the tempfile path was very long, which happened sometimes on macOS. This no longer seems to be a problem though, so I think that previous length restriction is no longer an issue. Nice that we can remove it now!

@kevinmcconnell kevinmcconnell merged commit cf2ec5c into basecamp:main Dec 12, 2024
1 check passed
@erka erka deleted the cleanup-test-helpers branch December 12, 2024 17:38
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.

2 participants