# Running @testitem in VS Code fails

**URL:** <https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527>\
**Category:** VS Code\
**Tags:** package, testing, vscode\
**Created:** [November 21, 2023, 1:49pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527 "2023-11-21T13:49:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias-Thomas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias-thomas/32/20416_2.png) [@Tobias-Thomas](https://discourse.julialang.org/u/Tobias-Thomas)\
**Post date:** [November 21, 2023, 1:49pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/1 "2023-11-21T13:49:38Z")

</div>

Hi everyone,  
I am currently developing a small package and wrote some Unit-tests for it. Since I am developing it in VS Code, I am using the [TestItemRunner.jl](https://github.com/julia-vscode/TestItemRunner.jl) package.  
The tests also work as expected when using the Package mode in the REPL and executing `test PackageName`.  
Yet when using the VS Code UI to execute a test set, I only receive the error “Unable to identify a Julia package for this test item.” and the only place where I found this error was as part of the source code of Julia VS Code extension ([https://github.com/julia-vscode/julia-vscode/blob/e9cf19424667c69105f6307cc04f0d81a3363f40/src/testing/testFeature.ts#L330](https://github.com/julia-vscode/julia-vscode/blob/e9cf19424667c69105f6307cc04f0d81a3363f40/src/testing/testFeature.ts#L330), line 330), yet I was unable to understand what causes this error.  
Is there a common mistake that causes this error?

Kind regards,  
Tobias

Maybe relevant info:  
I am using the “new” way of specifying test-specific dependencies (i.e. with an additional test/Project.toml file), but have also tested the “old” way and it has not changed anything.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [November 21, 2023, 2:21pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/2 "2023-11-21T14:21:27Z")

</div>

Is your directory `PackageName` or `PackageName.jl`? I think there’s still a bug in the extension where it only works for the former name (without `jl`).

---

<div class="post-metadata">

**Author:** ![Tobias-Thomas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias-thomas/32/20416_2.png) [@Tobias-Thomas](https://discourse.julialang.org/u/Tobias-Thomas)\
**Post date:** [November 21, 2023, 2:29pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/3 "2023-11-21T14:29:54Z")

</div>

The folder was indeed named `PackageName.jl` before but renaming it did not change anything, but still, thank you!

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [November 21, 2023, 2:40pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/4 "2023-11-21T14:40:03Z")

</div>

Then don’t know… But the testrunner definitely works with test/Project.toml.

---

<div class="post-metadata">

**Author:** ![Tobias-Thomas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias-thomas/32/20416_2.png) [@Tobias-Thomas](https://discourse.julialang.org/u/Tobias-Thomas)\
**Post date:** [November 22, 2023, 10:07am UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/5 "2023-11-22T10:07:21Z")

</div>

Do you maybe have a public package on top of your mind that has such a setup? Maybe I can find the causing difference to my setup.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 22, 2023, 10:16am UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/6 "2023-11-22T10:16:04Z")

</div>

This is a small package that uses it: [GitHub - m3g/ChunkSplitters.jl: Simple chunk splitters for parallel loop executions](https://github.com/m3g/ChunkSplitters.jl)

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [November 22, 2023, 12:04pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/7 "2023-11-22T12:04:13Z")

</div>

I use `test/Project.toml` in all my packages, and also use `@testitem`s in many of them. A basic example is [Alexander Plavin / Skipper.jl · GitLab](https://gitlab.com/aplavin/Skipper.jl).

---

<div class="post-metadata">

**Author:** ![Tobias-Thomas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias-thomas/32/20416_2.png) [@Tobias-Thomas](https://discourse.julialang.org/u/Tobias-Thomas)\
**Post date:** [November 22, 2023, 3:58pm UTC](https://discourse.julialang.org/t/running-testitem-in-vs-code-fails/106527/8 "2023-11-22T15:58:16Z")

</div>

Thanks to both of you, after having tested some more stuff out, I finally figured out, that it was because I was missing the `version` field in the base `Project.toml` file.
