Using a multi repo workspace our junit tests aren't being found by the Test Runner in VS Code. Meaning I can't run any tests directly in VS Code. If I run maven in a terminal/command the tests runs how I expect it to. The tests exist inside the web folder.
workspace/
├─ Repo 1/
│ ├─ automation folder/
│ │ ├─ src/
│ │ │ ├─ test/
│ │ │ │ ├─ web/
│ ├─ pom.xml
├─ Repo 2/
If I move the pom file up into the workspace folder it sees my files as junit tests and I can run them directly in VS code again.
workspace/
├─ Repo 1/
│ ├─ automation folder/
│ │ ├─ src/
│ │ │ ├─ test/
│ │ │ │ ├─ web/
├─ Repo 2/
├─ pom.xml
Is there a way to config VS code to recognize the files are junit tests when the pom is inside Repo 1.
If that isn't possible is there a way to commit files to Repo 1 when they exist outside of the folder?
Using a multi repo workspace our junit tests aren't being found by the Test Runner in VS Code. Meaning I can't run any tests directly in VS Code. If I run maven in a terminal/command the tests runs how I expect it to. The tests exist inside the web folder.
workspace/
├─ Repo 1/
│ ├─ automation folder/
│ │ ├─ src/
│ │ │ ├─ test/
│ │ │ │ ├─ web/
│ ├─ pom.xml
├─ Repo 2/
If I move the pom file up into the workspace folder it sees my files as junit tests and I can run them directly in VS code again.
workspace/
├─ Repo 1/
│ ├─ automation folder/
│ │ ├─ src/
│ │ │ ├─ test/
│ │ │ │ ├─ web/
├─ Repo 2/
├─ pom.xml
Is there a way to config VS code to recognize the files are junit tests when the pom is inside Repo 1.
If that isn't possible is there a way to commit files to Repo 1 when they exist outside of the folder?
Where is the VS Code runner looking? It would be helpful to know how you're calling it in CLI as well.
It kind of sounds to me like VS Code is considering workspace/
to be the root of the project, so the pom.xml
only works correctly when it's effectively serving as the POM for workspace/
.
Somehow, the IDE doesn't consider Repo 1/
as its own maven project. When you test in CLI, which directory are you calling mvn test
? Are you calling it from Repo 1/
?
Ended up just removing the Repo 1 folder with a new clone of the repo.
git clone REPO1 .