microsoft / microsoft/vscode-java-test

Maven forkCount and reuseForks apparently not respected

Aperta
#1,654 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

ai-triaged enhancement maven question test-execution
Lingua principale
TypeScript
Stelle
340
Fork
173
Merge medio
1g 19h
PR unite (30g)
18

Descrizione

Hello,

I am using systemstubs library.

As its author said, because of the way the library works, tests using it must be running in a forked vm, one per test.

I have been able to make this work in maven.

I have a multi module pom.xml. In my specific module pom.xml I configured sure-fire as follows:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>

                <configuration>
                    <forkCount>2.5C</forkCount>
                    <reuseForks>false</reuseForks>
                </configuration>

            </plugin>

This makes tests run by maven in cli run correctly.

However, when I run tests in vs code, they behave exactly as like they did when maven had not been configured with 1 fork, not reusing forks.

it seems as if not only is vs code not forking vms, it is running even methods in paralel, because tests in the same class are conflicting, while they should run sequentially in one thread, one after the other, in a class exclusive jvm process as maven is doing.

This makes me believe that either

  • vscode has its own runner and does not delegate to maven the test running OR
  • Some how delegation is ignoring the specific configuration in the module's pom.xml.

I have been searching a way to let vscode test runner know tthat either it should fork jvm process and run one test in each vm or it should delegate and follow what is specified in pom.xml.

Another desired and may be faster solution is to find (something I haven't found either) a way of asking vscode to just ignore these tests when running tests, so that we stop having failures on the test result.

Can you please provide me with information on how to proceed?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproducete il comportamento con il pom.xml del modulo, le impostazioni di maven-surefire-plugin e il test runner di VS Code, confrontando l’esecuzione di Maven tramite CLI con l’esecuzione tramite VS Code. Verificate se il runner di VS Code delega a Maven e come gestisce forkCount, reuseForks e le esclusioni dei test. Il lavoro è completato quando il comportamento supportato o la limitazione è stata stabilita e la configurazione o il workaround richiesto è chiaramente documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, vscode
Ambito
devtools, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.