Open MilesCranmer opened 1 month ago
I have the same problem. What I did (as a workaround) was to put the preferences inside test/Project.toml
[deps]
...
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
[preferences.MyPkg]
variable = something
This is not ideal, as it cannot be .gitignore'd, but is the only solution I found to work for the VSCode tests and also ] test
in the REPL. You need to restart VSCode to make the new preference take effect.
Thanks! TIL you can set Preferences in the Project.toml.
There was a bug in the VS Code extension runner where it didn't pick up your local env. I just fixed that in the prerelease of VS Code. I'm not sure whether that will also fix this issue here, but worth trying. Could you give it a shot?
I just tried the VS Code extension 1.114.1 (pre-release), and I am still observing the same problem (] test
picks up the test/LocalPreferences.toml, but the VSCode tests don't)
Ok, this is actually an upstream problem: https://github.com/JuliaTesting/TestEnv.jl/issues/59
It seems like the VSCode test runner is unaware of the LocalPreferences.toml in my base directory. Is there any way I should be declaring it? I tried putting it in
test/
too but no luck.For the record,
test/LocalPreferences.toml
works if I'm running withPkg.test()
. But the VSCode test runner doesn't seem to use it?