mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
TestE2E already set up the sandbox, slots, locks and flags itself, so the 898-line script only handed over. The run is now `mise run e2e -- FLAGS` (go test -tags e2e from tests/e2e, CGO_ENABLED=0) with the same flags: --only, --from, --clean, --every-feature, --slots, --slot, --newest-base, --golden, plus --reuse. - options: the flags named as the script's options; the hand-over flags (lock-holder, count, total, started, summary) and the ported/unported split are gone. - e2eUbuntuRelease, a const in sandbox_test.go, holds the Ubuntu pin; scripts/bump.sh e2e-ubuntu moves it (get_const), and TestE2EUbuntuPins, bump.txtar and the E2E workflow read it there. - From the script into Go: the OpenSSL-not-LibreSSL host check, and --newest-base's start line and its UPSTREAM DRIFT summary. - The script's leftover bash helpers (perl vm_state, no_leak, ca_*, lima_listens, the retry list, its heartbeat) are gone with it. - mise's e2e:go task merges into e2e; TestCommandLines drops its $D rule. - Docs (contributing, testing, maintaining, internals) and AGENTS.md name mise run e2e; testing.md's "Porting a section" becomes "Adding a section". Co-Authored-By: Claude Opus 5.5 <[email protected]>
63 lines
2.1 KiB
Go
63 lines
2.1 KiB
Go
//go:build e2e
|
|
|
|
package e2e
|
|
|
|
import "runtime"
|
|
|
|
// section is one of e2e's sections: its name, its time when it has never
|
|
// run (for --slots to place it), the host commands it uses beyond
|
|
// baseTools, and its checks, each section in a file of its own
|
|
// (gc_test.go).
|
|
type section struct {
|
|
name string
|
|
guess int // seconds
|
|
tools []tool
|
|
run func(*S)
|
|
}
|
|
|
|
// sections is every section, in the order a run runs them.
|
|
func sections() []section {
|
|
return []section{
|
|
{name: "images", guess: 600, run: imagesSection},
|
|
{name: "project", guess: 900, tools: projectTools(), run: projectSection},
|
|
{name: "clone", guess: 120, tools: []tool{gitTool(), sshTool()}, run: cloneSection},
|
|
{name: "gc", guess: 120, run: gcSection},
|
|
{name: "tools", guess: 600, tools: []tool{sshTool()}, run: toolsSection},
|
|
{name: "network", guess: 600, tools: []tool{python3Tool(), sshTool()}, run: networkSection},
|
|
{name: "desktop", guess: 300, tools: []tool{listenTool()}, run: desktopSection},
|
|
{name: "nix", guess: 900, tools: []tool{sshTool()}, run: nixSection},
|
|
{name: "from", guess: 1800, run: fromSection},
|
|
{name: "link", guess: 900, tools: linkTools(), run: linkSection},
|
|
}
|
|
}
|
|
|
|
// listenTool is what lists this machine's listeners: lsof on macOS, ss
|
|
// on Linux.
|
|
func listenTool() tool {
|
|
if runtime.GOOS == "darwin" {
|
|
return tool{"lsof", "lsof", "-", "-"}
|
|
}
|
|
return tool{"ss", "-", "iproute2", "iproute"}
|
|
}
|
|
|
|
// projectTools is what the project section runs on this machine: git,
|
|
// OpenSSL's s_server, OpenSSH's commands, tar, ps, the listeners' lister,
|
|
// and a terminal for a question (script on macOS, Python's pty on Linux).
|
|
func projectTools() []tool {
|
|
tty := tool{"script", "-", "-", "-"}
|
|
if runtime.GOOS != "darwin" {
|
|
tty = tool{"python3", "-", "python3", "python3"}
|
|
}
|
|
return []tool{
|
|
gitTool(),
|
|
{"openssl", "openssl@3", "openssl", "openssl"},
|
|
sshTool(),
|
|
{"ssh-agent", "openssh", "openssh-client", "openssh-clients"},
|
|
{"ssh-add", "openssh", "openssh-client", "openssh-clients"},
|
|
{"ssh-keygen", "openssh", "openssh-client", "openssh-clients"},
|
|
{"tar", "gnu-tar", "tar", "tar"},
|
|
{"ps", "-", "procps", "procps-ng"},
|
|
listenTool(), tty,
|
|
}
|
|
}
|