-
Notifications
You must be signed in to change notification settings - Fork 11
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
Test item seems to fail only in VS Code #38
Comments
Hm, this must somehow depend on the |
I think I remember @nalimilan being involved in this for Base Julia; i.e. it decides whether the print the module name based on what is currently loaded/reachable in the current scope? So if a submodule is loaded, then it won't print the parent module prefix anymore because the submodule itself is reachable? Something along those lines. |
The relevant pieces of code are https://github.com/julia-vscode/TestItemRunner.jl/blob/main/src/TestItemRunner.jl#L62 and https://github.com/julia-vscode/julia-vscode/blob/main/scripts/packages/VSCodeTestServer/src/VSCodeTestServer.jl#L56. From just staring at it, I can't really see a difference that would explain this... In both cases we create a new module inside of |
Actually, I know what is happening here :) https://github.com/JuliaStrings/InlineStrings.jl/pull/62/files#diff-3b9314a6f9f2d7eec1d0ef69fa76cfabafdbe6d0df923768f9ec32f27a249c63R2 is the reason there is a difference. That line loads the For a moment I thought we could actually store the temporary module where test code is executed in the |
Yeah, that all sounds right.
Well, that would fix the descrepency, by also making this test fail outside of VS Code... but it doesn't fix the issue which is this test should pass in VS Code. Otherwise, there's no way to test that (exported) types print the way we expect (i.e. without module qualification in environments where the module is loaded). |
I think this is kind of a hard corner case, because the behavior of the I think at the end of the day I would probably just change the test here, so that it includes the module name? And if you remove the |
I'm using TestItems and VS Code for the first time, so high chance of user error, but...
I tried changing a package over to use TestItems.jl (PR), and the tests pass when run on CI and when run locally in the REPL via
] test
, but fail in VSCodeThe test which fails (only in VS Code) is
which looks like a scoping issue?!
Code here: https://github.com/JuliaStrings/InlineStrings.jl/pull/62/files#diff-3b9314a6f9f2d7eec1d0ef69fa76cfabafdbe6d0df923768f9ec32f27a249c63L551-L560
(Also there seems to be an off-by-one error in the reporting of the failed test line number, see screenshot below)
p.s. let me know if there's a better place for this kind of issue
The text was updated successfully, but these errors were encountered: