mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
feat(pkg): classify postinstall failures and test them in ci
This commit is contained in:
1 parent
e8e04ae094
commit
dc39073a55
4 files changed
+665
-5
No files matched your search
@@ -179,14 +179,17 @@ func TestFailureCodeDocTableMatchesConstants(t *testing.T) {
|
||||
t.Fatalf("could not read the failure-code doc: %v", err)
|
||||
}
|
||||
doc := string(buf)
|
||||
// Package-stage rows document identifiers scripts/pkg/postinstall emits
|
||||
// on its own; they are not in this binary's failure-code registry, so
|
||||
// they sit outside the one-row-per-code count below.
|
||||
rows := 0
|
||||
for _, line := range strings.Split(doc, "\n") {
|
||||
if strings.HasPrefix(line, "| `") {
|
||||
if strings.HasPrefix(line, "| `") && !strings.Contains(line, "| package |") {
|
||||
rows++
|
||||
}
|
||||
}
|
||||
if rows != len(allProvisionFailureCodes) {
|
||||
t.Errorf("doc table has %d code rows, want %d", rows, len(allProvisionFailureCodes))
|
||||
t.Errorf("doc table has %d non-package code rows, want %d", rows, len(allProvisionFailureCodes))
|
||||
}
|
||||
for _, code := range allProvisionFailureCodes {
|
||||
row := "| `" + string(code) + "` | " + string(provisionStageForCode[code]) + " | " + strconv.Itoa(provisionExitCodeForCode[code]) + " |"
|
||||
|
||||
Reference in new issue
Block a user