Skip to content

feat: zero main package dependencies, improve tests #57

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

Closed
wants to merge 1 commit into from

Conversation

endigma
Copy link

@endigma endigma commented Apr 24, 2025

Summary

  • Moves tests into tests/ package, which is its own go module, to isolate testing dependencies from the main package
    • This makes it an easier decision to include litter in independent, downstream testing packages similar to testify, which was previously an indirect dependency of litter itself
    • It can confuse users when they install a testify alternative and it pulls in testify indirectly
    • This also caused litter to indirectly import its own alternative, spew, via testify
    • Also allows tests to freely import essentially any 3rd party package to add tests when an issue is resolved to prevent regressions
  • Uses normal assert.Equal instead of the diff shellout, which may be uglier but is more reliable

@atombender
Copy link
Member

Hello, thanks for the PR! There's a lot going on here that I think ideally should have been multiple PRs or commits so they could be reviewed separately:

  • Switch to using golden files
  • Split tests into using t.Run()
  • Move tests into its own module
  • Adopt gotestsum
  • Minor change to GitHub Actions config

These changes individually are all nice, though I think the main utility here being the move of tests into a module, which could be done without introducing autogold or gotestsum or changing the tests at all.

Since these three changes are commingled, I'll need some extra time to review, and my schedule is already very busy, so I can't promise anything quick. But I will say that if you submit a PR where you only to move the tests, I'd be able to merge it right away.

@endigma
Copy link
Author

endigma commented Apr 24, 2025

Yeah I agree it scope crept a bit as I kept working on it, I don't really want to keep track of a bunch of PRs, but I could rebase into more atomic commits if that would help? As for merge timeline, no rush, it doesn't matter much to me at all for the time being.

@atombender
Copy link
Member

I recommend Aviator or Graphite for PR stacking. 🙂 If you want to split it into commits that'd be nice, sure.

@endigma
Copy link
Author

endigma commented Apr 24, 2025

I'll check them out, do they work on arbitrary public repos? I've used merge queues like BORS before but not apps

@atombender
Copy link
Member

Not sure about Graphite, but the Aviator CLI can be used anywhere without special permissions to the repo and without needing to sign up for Aviator, as it's all client-side.

@atombender
Copy link
Member

@endigma
Copy link
Author

endigma commented Apr 29, 2025

@atombender this has been trimmed down to just moving the tests now

@endigma endigma closed this Apr 29, 2025
@ccoVeille
Copy link

@endigma
Copy link
Author

endigma commented Apr 29, 2025

Yep, wanted to not use main on my fork and GitHub doesn't allow that change on an existing PR.

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