feat(02-02): record manifest route cases and report coverage
Drive ordered route cases through RecordFlow, resume in batches of 15, and print recorded/passing/failing/unrecorded coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
53
tide/report.go
Normal file
53
tide/report.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package tide
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Coverage is the recorded/passing/failing/unrecorded table over manifest routes.
|
||||
type Coverage struct {
|
||||
Total int
|
||||
Recorded int
|
||||
Passing int
|
||||
Failing int
|
||||
Unrecorded int
|
||||
Pending int
|
||||
Ported int
|
||||
ResumeRemaining int
|
||||
Rows []CoverageRow
|
||||
Diffs []string
|
||||
}
|
||||
|
||||
// CoverageRow is one manifest route's outcome.
|
||||
type CoverageRow struct {
|
||||
ID string
|
||||
Status string
|
||||
Outcome string
|
||||
}
|
||||
|
||||
// CoverageHeaders is the table header for CLI output.
|
||||
func CoverageHeaders() []string {
|
||||
return []string{"route", "status", "outcome"}
|
||||
}
|
||||
|
||||
// CoverageRows renders the coverage table.
|
||||
func (c Coverage) CoverageRows() [][]string {
|
||||
rows := make([][]string, 0, len(c.Rows))
|
||||
for _, r := range c.Rows {
|
||||
rows = append(rows, []string{r.ID, r.Status, r.Outcome})
|
||||
}
|
||||
return rows
|
||||
}
|
||||
|
||||
// SummaryLine is a one-line recorded/passing/failing/unrecorded report.
|
||||
func (c Coverage) SummaryLine() string {
|
||||
return fmt.Sprintf("recorded %d/%d passing %d failing %d unrecorded %d", c.Recorded, c.Total, c.Passing, c.Failing, c.Unrecorded)
|
||||
}
|
||||
|
||||
func (c Coverage) ResumeLine() string {
|
||||
if c.ResumeRemaining <= 0 {
|
||||
return "manifest recording complete"
|
||||
}
|
||||
return "resume remaining " + strconv.Itoa(c.ResumeRemaining)
|
||||
}
|
||||
Reference in New Issue
Block a user