microsoft / microsoft/vscode-java-test

Branch code coverage not working properly

Offen
#1,751 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

ai-triaged bug test-reporting
Vorherrschende Sprache
TypeScript
Sterne
340
Forks
173
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
18

Beschreibung

I recently discovered the branch code coverage and I think it would be a very useful tool, however at the moment is buggy:

Image

In the case above it tells me the branch 6 has no coverage, which is the case when the first three statements are false.

Image

Here it tells me branch 2 is not covered, which is when the statement is false.

First of all maybe the fact that the statements are divided by lines shouldn't truncate the number of branches... If I put all statements in one line it would tell me that branch 8 is not covered (when all statements are false)

But most importantly as you can see branch 8 would be the one actually covered because the 'else' statement is all green. I could give you other examples where this is evident. Essentially what I am trying to say that if one of the branches is not covered at the moment the extension just says the last branch is not covered, when in fact in the case I gave you earlier I am pretty sure branch 7 (when now.equals(orarioFineEsec) equals true) is not covered, but I wouldn't know on the info that is given here.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

In dem Bericht wird keine Quelldatei, kein Test und kein Einstiegspunkt genannt. Beginnen Sie damit, die in den Screenshots beschriebene Anzeige der Branch-Coverage zu reproduzieren, und verfolgen Sie, wie abgedeckte und nicht abgedeckte Branches Anweisungen zugeordnet werden. Als erledigt gilt die Aufgabe, wenn die angezeigten Branch-Nummern und der Coverage-Status den tatsächlich nicht abgedeckten Branch sowohl in mehrzeiligen als auch in einzeiligen Fällen identifizieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, typescript
Bereich
devtools, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.