The delivery repository's contracts and SDK live under modules/ as mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths renamed to match the folders (the TypeScript names already did), and every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools and mesh-sdk follows in the same group: a design as it should be, one path per module, checked by the group's check building every importer. Builds: design 47 G §427, §88 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
47 lines
1.9 KiB
Go
47 lines
1.9 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
|
|
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
|
"git.novox.be/novox/mesh-sdk/go/forgekey"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
|
|
"git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep/conformance"
|
|
buildrun "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildrun"
|
|
)
|
|
|
|
// 1890/AC7: the module's own start sweep (endLeftRunning, as main runs it) keeps the conformance kit's left-running
|
|
// case: a step a previous process left running is ended at once and said, whatever its age, and a step of this process
|
|
// is kept.
|
|
func TestTheStartSweepEndsWhatAPreviousProcessLeft(t *testing.T) {
|
|
conformance.LeftRunning(t, func(ctx context.Context, scan buildrun.Scan, node string, before time.Time, logf func(string, ...any)) {
|
|
(&Module{Node: node}).endLeftRunning(ctx, scan, before, logf)
|
|
})
|
|
}
|
|
|
|
// ADR 0664 §1 (issue 1748): the module's own paths from a failed fetch or image build to its step's error say a network that
|
|
// did not answer as a transport fault, and a failure of the source (a RUN line that fails) as none.
|
|
func TestTheStepsSayAFailedNetworkAsATransportFault(t *testing.T) {
|
|
conformance.Passing(t, []string{conformance.GitFetch, conformance.BuildahBud}, func(runner, words string) error {
|
|
switch runner {
|
|
case conformance.GitFetch:
|
|
run := func(context.Context, []string, string, ...string) forgekey.Ran {
|
|
return forgekey.Ran{Status: 128, Stderr: words}
|
|
}
|
|
return buildstep.FetchCommit(context.Background(), run, t.TempDir(), "ssh://mesh-forge/o/r.git", strings.Repeat("a", 40), "")
|
|
default:
|
|
m, f, states := setup(t, same)
|
|
f.failBud = forgekey.Ran{Status: 125, Stderr: words}
|
|
_, st := runBuild(t, m, states, nil)
|
|
if st.Passing {
|
|
return &sdkstep.Passing{Err: errors.New(st.Reason)}
|
|
}
|
|
return errors.New(st.Reason)
|
|
}
|
|
})
|
|
}
|