It doesn’t seem to be possible to define groups of tests and then run only a given group of tests with Pkg.test. Is there an alternative recommended mechanism to achieve this goal?
Here is the use-case. I have a large package where running all the tests takes a long time. I am only working on a small part of it, so I would like to only run the tests related to the part that I am working on.
I could define test functions within the package, then import the package and call the test directly. This way I can organize things how I want, but I wonder if there is a more canonical way of doing it.
I think this would be a great feature. I usually separate out my tests into smaller file, and include them all into runtests.jl. It’s pretty easy to comment out the slow tests while developing.
Of course, this is a workaround. But this is not very robust. You might forget that you commented something, and I don’t think constantly changing a source file without need is good practice.
You can easily structure runtests.jl to select particular test groups depending on the environment.
Either write your own logic (following, e.g. DataStructures), or use @includetests from TestSetExtensions.
Is there any update on this? Most languages I used supports running single test or groups. It is really convenient and productive to be able to integrate with modern editor like vscode to click a button above the test code block to run single tests or save multiple run configurations of tests. Which is the repo to open a feature request for this, julia or Pkg?
It allows Pkg to pass arguments to the test process, but Pkg itself is not a testing framework so it is up to the testing framework you use to make use of those arguments.