You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sorry but I can't reproduce the example of the Medium post.
With this code:
import static org.junit.jupiter.api.DynamicContainer.dynamicContainer;
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.jupiter.api.DynamicContainer;
import org.junit.jupiter.api.TestFactory;
public class TestContainers {
@TestFactory
Collection<DynamicContainer> testContainer() {
List<DynamicContainer> containers = new ArrayList<>();
containers.add(
dynamicContainer("First Container", List.of(
dynamicTest("First test of first container", () -> {}),
dynamicTest("Second test of first container", () -> {})
))
);
containers.add(
dynamicContainer("Second Container", List.of(
dynamicTest("First test of second container", () -> {}),
dynamicTest("Second test of second container", () -> {})
))
);
return containers;
}
}
I get
TestContainers > testContainer() > First Container > TestContainers.First test of first container PASSED
TestContainers > testContainer() > First Container > TestContainers.Second test of first container PASSED
TestContainers > testContainer() > Second Container > TestContainers.First test of second container PASSED
TestContainers > testContainer() > Second Container > TestContainers.Second test of second container PASSED
as gradle testoutput, but this in the sidebar
So apparently the two containers are there, but are not viewable.
My understanding is that the Test Explorer (sidebar) is used to show all the tests in the workspace. While the Test Result (panel) is used to show the tests of each execution.
We have an issue about improve the Test Result content: #1588
Since last update (using Java 25). In the testing panel first the > indicating the presence of an hierarchy of results appears for a few seconds and then the panel re-draws and the hierarchy disappears.
No errors in the console, non failed tests in the testing result panel. At the end you get:
But as you can see, the side panel "reloads" somehow loosing the hierarchy information.
Activity
jdneo commentedon Sep 29, 2023
Thank you for reporting this bug.
Though it's not related with #1603, but this reflects some 'bad' design/implementation when handling the invocation/dynamic tests.
Some refactoring is needed.
[-]JUnit5 DynamicContainer are not wokring[/-][+]JUnit5 DynamicContainer are not working[/+]jdneo commentedon Sep 29, 2023
Please use this private build to unblock yourself:
vscode-java-test-0.40.2023092907.vsix.zip
The PR still needs more days (~ 1 week) to be merged due to the holiday here. If you find any issue using the private bit, please let me know.
mapio commentedon Oct 9, 2023
I've tested it. It's true that now tests in a container are picked up. But test reports do not show any form of hierarchy.
According to this post for example it should go from
to
.
jdneo commentedon Oct 9, 2023
What did you see from your side?
mapio commentedon Oct 9, 2023
I'm sorry but I can't reproduce the example of the Medium post.
With this code:
I get
as
gradle testoutput, but this in the sidebarSo apparently the two containers are there, but are not viewable.
mapio commentedon Oct 9, 2023
Ahah, my fault. I was looking at the "Testing result" panel, not at the testing sidebar. There the containers show up!
So now the question is: why the UI of the panel and sidebar are different?
jdneo commentedon Oct 10, 2023
My understanding is that the Test Explorer (sidebar) is used to show all the tests in the workspace. While the Test Result (panel) is used to show the tests of each execution.
We have an issue about improve the Test Result content: #1588
mapio commentedon Oct 10, 2023
The explanation makes a lot of sense! Thank you for referring me to the other issue. You are very helpful, thank you for your time and work!
mapio commentedon Sep 29, 2025
I think we have a regression.
Since last update (using Java 25). In the testing panel first the
>indicating the presence of an hierarchy of results appears for a few seconds and then the panel re-draws and the hierarchy disappears.No errors in the console, non failed tests in the testing result panel. At the end you get:
But as you can see, the side panel "reloads" somehow loosing the hierarchy information.
Screencast.from.2025-09-29.09-46-54.mp4