Closed Arthurm1 closed 1 month ago
Added support for buildTarget/test
so tests can now be run at the class level.
I've also changed BuildTargetServerIntegrationTest
to create a client for recording of server messages e.g. test reports.
Added support for buildTarget/run
rebased
Hi @Arthurm1,
some rebase work might need for this PR. Before that, may I ask the reason why you want the BS to support test discovery?
(I haven't look through the change, but looks like test discovery is not covered in BSP, is it correct?)
rebased
(I haven't look through the change, but looks like test discovery is not covered in BSP, is it correct?)
Test discovery is a JVM only extension: https://build-server-protocol.github.io/docs/extensions/jvm#buildtargetjvmtestenvironment-request
Metals can do test discovery on its own on the currently open file but it's slightly painful as it has to know how to use each test framework and there are many: JUnit, TestNG, ScalaTest, MUnit, ScalaCheck, Specs2... Even with that, it wouldn't be able to discover any custom defined tests in Gradle
My thought about the test support is that we can do it progressively.
So the first step can be:
The next step can be the discovery support (considering currently the test discovery only support the class level). WDYT?
And if possible, separate the the run and test support in different PRs would definitely help a lot :)
So you want me to split into 3 PRs? Test Discovery, Test Run, Main Run?
So you want me to split into 3 PRs? Test Discovery, Test Run, Main Run?
Thank you. If you don't mind to do the split, That would be great :)
And I hope the order could be Test Run, Main Run, Test Discovery
. Due to that the Test delegation is frequently asked from the community in VS Code Java.
Implements BSP test discovery. Only returns the classes but BSP doesn't seem to allow test discovery down to the method level.
Requires Gradle >= 8.3 as
--test-dry-run
has only recently been added. There doesn't appear to be any other way to discover tests.This is what this project looks like in VSCode test explorer![image](https://github.com/microsoft/build-server-for-gradle/assets/5612295/93743769-0caf-4d16-a625-eeb5b6f95360)