wtfutil / wtf

The personal information dashboard for your terminal
http://wtfutil.com
Mozilla Public License 2.0
15.69k stars 800 forks source link

Make unit tests entirely contained to the project #1612

Open Fryuni opened 1 year ago

Fryuni commented 1 year ago

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 commented 12 months ago

That's a great idea, I like it.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.