brew test
and sandbox
#2604
-
I am looking to add a new formula for a CLI tool: https://github.com/ninxsoft/mist My formula's now passing various However, by nature of how it calls macOS Foundation APIs to fetch a URL (it does a "get me the latest known version" check as part of printing the tool's version), the runtime ends up wanting to write some cache data into Is there any sane way to side-step this inside of how the brew test block is executed? I'm thinking that even if the sandbox could be disabled when the test block happens, the cache cleanup logic starts to make this messy. Alternatively I can look to add a feature to the tool to disable the network lookup via some flag. But just wanted to ask since I figured that this may have been an issue that's come up before? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The HOME variable should be set to the test path, so
Just checking the version of a tool is considered a bad test, see https://docs.brew.sh/Formula-Cookbook#add-a-test-to-the-formula |
Beta Was this translation helpful? Give feedback.
The HOME variable should be set to the test path, so
~/Library/Caches
should work just fine.Just checking the version of a tool is considered a bad test, see https://docs.brew.sh/Formula-Cookbook#add-a-test-to-the-formula