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

Right way to pass LocalPreferences.toml to VSCode test environment? #86

Open
MilesCranmer opened this issue Aug 4, 2024 · 5 comments
Open
Labels

Comments

@MilesCranmer
Copy link

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 with Pkg.test(). But the VSCode test runner doesn't seem to use it?

@cncastillo
Copy link

cncastillo commented Aug 21, 2024

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.

@MilesCranmer
Copy link
Author

Thanks! TIL you can set Preferences in the Project.toml.

@davidanthoff
Copy link
Member

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?

@cncastillo
Copy link

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)

@davidanthoff
Copy link
Member

Ok, this is actually an upstream problem: JuliaTesting/TestEnv.jl#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants