Skip to content

Commit

Permalink
fixed total duration and uppercase RUN/PAUSE
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed Oct 6, 2024
1 parent 07b4aa6 commit f29c1bd
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 433 deletions.
4 changes: 2 additions & 2 deletions chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func generateCharts(pr ParseResult) []PlotlyChart {
slog.Debug("Test was paused", "startAfter", startAfter, "duration", duration, "test", tn)

ch.Add(
fmt.Sprintf("%s pause (%s)", packageNameFull, duration.Round(time.Millisecond).String()),
fmt.Sprintf("%s PAUSE (%s)", packageNameFull, duration.Round(time.Millisecond).String()),
y,
startAfter,
duration,
Expand All @@ -66,7 +66,7 @@ func generateCharts(pr ParseResult) []PlotlyChart {
slog.Debug("Test was executed", "startAfter", startAfter, "duration", duration, "test", tn)

ch.Add(
fmt.Sprintf("%s run (%s)", packageNameFull, duration.Round(time.Millisecond)),
fmt.Sprintf("%s RUN (%s)", packageNameFull, duration.Round(time.Millisecond)),
y,
startAfter,
duration,
Expand Down
4 changes: 3 additions & 1 deletion html.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ body {
}
}

duration := pr.End.Sub(pr.Start)

buf := new(strings.Builder)
err = t.Execute(buf, map[string]any{
"plotly": template.JS(plotly),
Expand All @@ -221,7 +223,7 @@ body {
"callOnLoad": callOnLoad,
"passed": passed,
"failed": failed,
"duration": pr.MaxDuration.Round(time.Millisecond).String(),
"duration": duration.Round(time.Millisecond).String(),
})
if err != nil {
return "", fmt.Errorf("error executing template: %w", err)
Expand Down
Loading

0 comments on commit f29c1bd

Please sign in to comment.