Does `[python].default_run_goal_use_sandbox = fals...
# general
r
Does
[python].default_run_goal_use_sandbox = false
allow you to write non-hermetic test cases, e.g. tests on code that reads files directly from the source tree without specifying them as dependencies? It seems like the answer is no but I'm curious how that's the case without sandboxing / hoping there is a way to (temporarily) write non-hermetic tests.
b
It's only for the
run
goal. If you have the test runner in a file that you're
run
-nin then yes ๐Ÿ˜Š
๐Ÿฅน 1
h
But that would not be a good way to run tests
E.g., you would get no caching
b
I suspect this might be for VCR recording or similar snapshot testing where you wanna write the snapshot
h
The non-hermeticity is for loading code that you donโ€™t have a dep on?
r
^Yeah. We just have a lot of these use cases where code searches the repo sources. It would be nice if there was a way to discard hermeticity temporarily for onboarding.
But at some point the right solution is explicit deps either in test cases or in the underlying code
h
lemme think about that one
๐Ÿ™ 1
is it the test that searches the repo, or the code being tested?
r
From what I can tell it's usually the code itself. But the code is often a wrapper for searching the repo
b
Hmm this makes me think we should make it "execution use sandbox" which could be used for test as well
h
Iโ€™m trying to figure out what invalidation should be like in this case
It sounds like any change in any file in the repo must invalidate the tests that do this searching?
b
Much like run, the final process isnt cached
It can't be. For something like VCR it makes network requests, which can't be cached ๐Ÿ˜…
r
I imagine any non-hermetic solution will fail to ensure that the test cache entry is still valid. It's as if you add HTTP calls to your tests
Which is not nice but... depending on how much you value purity...
b
I wouldn't call it impure, you're just forcibly rerunning it in a way it can write to disk meaningfully
If you file an issue I'll look at it
r
Oh I see, so for these non-hermetic tests you just wouldn't cache. That works. Let me file
b
This actually scratches an itch I've been having ๐Ÿ˜Š
r