julia-vscode / TestItemRunner.jl

Run Julia test items
MIT License
67 stars 11 forks source link

Project is not detected when running from REPL #23

Open ktdq opened 1 year ago

ktdq commented 1 year ago

@run_package_tests and run_tests fail to detect current project when run from REPL and all tests fail. Can Pkg.project() be used in this case?

davidanthoff commented 1 year ago

So, the idea is that you just put @run_package_tests into your test/runtests.jl file, but not call it directly. From the REPL you would either go into REPL mode and just run ] test or run Pkg.test("MyPackage") or something like that. And that should all work, right?

ktdq commented 1 year ago

This all works, but I was trying to run tests for one folder only, not all tests.

davidanthoff commented 1 year ago

Ah, yes, that is not yet supported here. We'll need a generic filtering mechanism, and I first want to add support for tags and then I was thinking I would try to tackle filtering from the command line. My rough idea is that you might be able to do something like

TestItemRunner.test(packagename, filter=i -> :tag1 in i.tags)

or something like that. i would presumably also give access to the name and file location of a given test item.

davidanthoff commented 1 year ago

Oh, but you should be able to run the tests in a specific folder/file in the VS Code UI, of course.