model

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package model defines the format-agnostic test result types that all parsers produce and all renderers consume.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	Title     string
	Sources   []string // original input paths / labels
	Timestamp time.Time
	Duration  time.Duration
	Suites    []Suite
}

Report is the top-level, format-independent result tree.

func (*Report) Merge

func (r *Report) Merge(other *Report)

Merge folds other into r, combining suites that share a name. Duration is set to the maximum of the two reports.

func (*Report) Stats

func (r *Report) Stats() (total, passed, failed, skipped int)

Stats returns aggregate pass/fail/skip counts and total.

type Status

type Status string

Status is the outcome of a single test case.

const (
	StatusPass Status = "pass"
	StatusFail Status = "fail"
	StatusSkip Status = "skip"
	// StatusFlaky indicates a test that failed but ultimately passed after retries.
	StatusFlaky Status = "flaky"
)

StatusPass, StatusFail, StatusSkip, and StatusFlaky are the possible test outcome values.

type Suite

type Suite struct {
	Name  string
	Cases []TestCase
}

Suite groups related test cases under one name.

type TestCase

type TestCase struct {
	Suite       string // Logical grouping: classname, package path, file name, …
	Name        string // Test identifier
	Status      Status
	Duration    time.Duration
	Message     string   // Failure / error / skip reason
	Stdout      string   // Captured output; non-empty only for failures
	File        string   // Source file path (available from GTest XML)
	Line        int      // Source line number (available from GTest XML)
	Attachments []string // file paths or base64 data URIs (e.g. from Playwright/Cypress)
}

TestCase holds the normalised result of one test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL