microsoft / microsoft/vscode-java-test

Test Runner for Java ignores @BeforeAll annotations on test classes

Open
#1,756 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged bug gradle junit test-execution
Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 19h
Merged PRs (30d)
18

Description

Symptom: JUnit 5 test methods in a test class with an @BeforeAll method are correctly initialised and pass when run with gradlew test but do not get correctly initialised and fail when the test method is run individually in the VSCode IDE.

System: Windows 10, VSCode 1.96.3, Gradle 8.12, Spring Boot 3.4.1, Java 21.04, JUnit 5.11.4

Related issue: #1748

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issue #1748 and reproducing the difference between Gradle test execution and running an individual test in VSCode on the reported Windows, Java, Gradle, Spring Boot, and JUnit setup. Trace the Java test runner path for @BeforeAll handling; done means test classes initialize correctly and pass when individual methods are run from VSCode.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
devtools, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.