C3: mesh-build-node and mesh-build-image say a failure of the network as a transport fault (npm ci, buildah bud, the image seat's mirror) (ADR 0664 §1, issue 1748)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -86,6 +87,18 @@ func TestAMissingToolchainDirectoryIsInstalledOnceFromTheLock(t *testing.T) {
|
||||
if err := tc.Ensure(context.Background(), version); err != nil || len(fake.calls) != 1 {
|
||||
t.Errorf("a present directory ran npm again: %d calls, %v", len(fake.calls), err)
|
||||
}
|
||||
// ADR 0664 §1 (issue 1748): an install the network cut is a transport fault, the bus gives the ask again; a package the
|
||||
// registry lacks is not.
|
||||
for _, c := range []struct {
|
||||
stderr string
|
||||
passing bool
|
||||
}{{"npm error code ECONNRESET\nnpm error network aborted", true}, {"npm error code EAI_AGAIN", true}, {"npm error code E404\nnpm error 404 Not Found", false}} {
|
||||
bad := &fakeNpm{ran: forgekey.Ran{Status: 1, Stderr: c.stderr}}
|
||||
err := toolchainIn(t, bad).Ensure(context.Background(), Recipe{Steps: "2", Lock: "y"}.Version())
|
||||
if err == nil || sdkstep.IsPassing(err) != c.passing {
|
||||
t.Errorf("%q: %v, passing %v, want %v", c.stderr, err, err != nil && sdkstep.IsPassing(err), c.passing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 1488/AC4: the install is told the mesh's registry for @novox with the account's credential, and only through a
|
||||
|
||||
Reference in New Issue
Block a user