Close out the completed audit
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -66,26 +65,6 @@ func TestReleaseWorkflowRequiresValidation(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoadmapTraceabilityOwnersAreComplete(t *testing.T) {
|
||||
root := repositoryRoot(t)
|
||||
data, err := os.ReadFile(filepath.Join(root, "docs", "roadmap", "implementation.md"))
|
||||
if err != nil {
|
||||
t.Fatalf("read implementation roadmap: %v", err)
|
||||
}
|
||||
|
||||
statuses := roadmapSummaryStatuses(t, string(data))
|
||||
checked := 0
|
||||
for _, owner := range roadmapTraceabilityOwners(t, string(data)) {
|
||||
checked++
|
||||
if statuses[owner] != "Completed" {
|
||||
t.Errorf("traceability owner %d has status %q, want Completed", owner, statuses[owner])
|
||||
}
|
||||
}
|
||||
if checked == 0 {
|
||||
t.Fatal("roadmap traceability inventory has no owners")
|
||||
}
|
||||
}
|
||||
|
||||
func repositoryRoot(t *testing.T) string {
|
||||
t.Helper()
|
||||
root, err := filepath.Abs(filepath.Join("..", ".."))
|
||||
@@ -145,53 +124,6 @@ func relativeToRoot(root, path string) string {
|
||||
return relative
|
||||
}
|
||||
|
||||
func roadmapSummaryStatuses(t *testing.T, document string) map[int]string {
|
||||
t.Helper()
|
||||
statuses := map[int]string{}
|
||||
for _, line := range strings.Split(document, "\n") {
|
||||
fields := strings.Split(line, "|")
|
||||
if len(fields) != 6 {
|
||||
continue
|
||||
}
|
||||
owner, err := strconv.Atoi(strings.TrimSpace(fields[1]))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
statuses[owner] = strings.TrimSpace(fields[4])
|
||||
}
|
||||
if len(statuses) == 0 {
|
||||
t.Fatal("roadmap summary has no status entries")
|
||||
}
|
||||
return statuses
|
||||
}
|
||||
|
||||
func roadmapTraceabilityOwners(t *testing.T, document string) []int {
|
||||
t.Helper()
|
||||
const inventoryHeading = "## Finding traceability inventory"
|
||||
const nextHeading = "## Open Questions"
|
||||
start := strings.Index(document, inventoryHeading)
|
||||
if start < 0 {
|
||||
t.Fatal("roadmap traceability inventory is missing")
|
||||
}
|
||||
inventory := document[start+len(inventoryHeading):]
|
||||
if end := strings.Index(inventory, nextHeading); end >= 0 {
|
||||
inventory = inventory[:end]
|
||||
}
|
||||
|
||||
owners := []int{}
|
||||
for _, line := range strings.Split(inventory, "\n") {
|
||||
fields := strings.Split(line, "|")
|
||||
if len(fields) != 4 {
|
||||
continue
|
||||
}
|
||||
owner, err := strconv.Atoi(strings.TrimSpace(fields[2]))
|
||||
if err == nil {
|
||||
owners = append(owners, owner)
|
||||
}
|
||||
}
|
||||
return owners
|
||||
}
|
||||
|
||||
type woodpeckerWorkflow struct {
|
||||
Steps map[string]woodpeckerStep `yaml:"steps"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user