Skip to content

Commit

Permalink
feat(plugin): Send metrics on finishing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyaPeyaPeyang committed Dec 30, 2024
1 parent 2bd520a commit 822cde9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ private final class MetricsTestReporter extends AbstractTestReporter
@Override
public void onTestSessionEnd(@NotNull ScenarioSession session)
{
boolean isFirstRun = ScenamaticaMetrics.this.totalTests == 0;

ScenamaticaMetrics.this.totalTests += (int) session.getScenarios().stream()
.filter(scenario -> scenario.getResult() != null)
.count();

if (isFirstRun)
ScenamaticaMetrics.sendMetrics();
}
}
}

0 comments on commit 822cde9

Please sign in to comment.