question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code lens run/debug test only works if the test is in the root folder of the test project

See original GitHub issue

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

VS Code version: Version 1.3.0-insider (1.3.0-insider) 93e65224d7598017bfa0b188a0d82b66a2ee9698

C# Extension version: 1.1.6

Steps to reproduce

Have a test project, with a test that isn’t in the root of that project Use the code lens run/debug test

Expected behavior

Test either runs or debugs based on the choice

Actual behavior

The following exception is throw:

dotnet-test Error: 0 : System.InvalidOperationException: /Users/foo/code/foo.Tests/TestCaseFolder/project.json does not exist.
   at Microsoft.DotNet.Tools.Test.TestCommand.GetProjectPath(String projectPath)
   at Microsoft.DotNet.Tools.Test.TestCommand.DoRun(String[] args)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
troydaicommented, Jun 20, 2016

@eamodio thanks for filing this issue.

0reactions
DustinCampbellcommented, Apr 27, 2017

This was fixed in 1.9.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run/Debug code lenses don't appear · Issue #470 - GitHub
I guess I got the root cause of this problem. In our implementation, we will only search for the test items in the...
Read more >
Debug / Run part of unit test CodeLens for is not showing
Create new unit test project, build it. Debug / Run part of unit test CodeLens for is not showing. Fixed In: Visual Studio...
Read more >
vscode jest extension doesn't work properly - Stack Overflow
Running npm run test on the WSL2 terminal worked, but the extension didn't. My folder structure was root __tests__ __testThis__ featureA.js <-- jest...
Read more >
Visual Studio Code | Metals - Scalameta
Metals is developed on many operating systems and every PR is tested on Ubuntu, ... However, if you want to work on Scala...
Read more >
Run/Debug Configuration: Mocha - PyCharm - JetBrains
By default, the Working directory field shows the project root folder. ... If during test execution PyCharm runs against a test of another...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found