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

Make unit tests entirely contained to the project #1612

Open
Fryuni opened this issue Jul 23, 2023 · 1 comment
Open

Make unit tests entirely contained to the project #1612

Fryuni opened this issue Jul 23, 2023 · 1 comment
Labels
💥 feature "Good luck, you're gonna need it."

Comments

@Fryuni
Copy link

Fryuni commented Jul 23, 2023

What should it do?

Some unit tests rely on the running user having permission to read and write files from outside of the project ($HOME/.config/wtf/log.txt for example).

Hermetic build systems, such as Bazel and Nix, execute tests without such permissions since everything should be reproducible, and touching files outside of the project breaks that clause. Currently building WTF with such tools require either skipping the test phase or manually ignoring every test that relies on such permissions.

My suggestion is to inject the path for such cases so test runs can read/write to files under testdata.

@senorprogrammer
Copy link
Collaborator

That's a great idea, I like it.

@senorprogrammer senorprogrammer added the 💥 feature "Good luck, you're gonna need it." label Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 feature "Good luck, you're gonna need it."
Development

No branches or pull requests

2 participants