Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions process_teststep.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ func (v *Venom) RunTestStep(ctx context.Context, e ExecutorRunner, tc *TestCase,
stepName = fmt.Sprintf("step_%d_%d", stepNumber, rangedIndex)
}
v.metricsCollector.RecordTestCheck(stepName, assertRes.OK)

// Record individual assertion results
for i, assertion := range assertRes.Assertions {
checkName := fmt.Sprintf("%s_assertion_%d", stepName, i)
v.metricsCollector.RecordTestCheck(checkName, assertion.IsOK)
}
}

if !assertRes.OK && len(assertRes.errors) > 0 {
Expand Down
3 changes: 3 additions & 0 deletions reporting/metrics_html.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"html/template"
"os"
"time"

"github.com/ovh/venom/reporting/aggregator"
)
Expand Down Expand Up @@ -54,9 +55,11 @@ func GenerateMetricsHTMLReportWithThresholds(metrics *aggregator.Metrics, output
data := struct {
MetricsJSON template.JS
ThresholdsJSON template.JS
GenerationTime string
}{
MetricsJSON: template.JS(metricsJSON),
ThresholdsJSON: template.JS(thresholdsJSON),
GenerationTime: time.Now().UTC().Format(time.RFC3339),
}

err = tmpl.Execute(file, data)
Expand Down
17 changes: 15 additions & 2 deletions reporting/metrics_html_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,7 @@ <h3 class="card-title">
// Global variables
let metricsData = {{.MetricsJSON }};
let thresholds = {{.ThresholdsJSON }};
let generationTime = "{{.GenerationTime}}";

// Utility functions
function debounce(func, wait) {
Expand Down Expand Up @@ -1865,8 +1866,20 @@ <h3 class="card-title">
});

function initializeReport() {
// Set generation time
document.getElementById('generation-time').textContent = new Date().toLocaleString();
// Set generation time in UTC
const utcTime = new Date(generationTime).toLocaleString('en-US', {
timeZone: 'UTC',
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
});

// Display UTC time
document.getElementById('generation-time').textContent = `${utcTime} UTC`;

// Load thresholds
loadThresholds();
Expand Down
Loading