Files
felhom-controller/controller/internal/stacks/r650_main_test.go
T

22 lines
949 B
Go

package stacks
import (
"os"
"testing"
"gitea.dooplex.hu/admin/felhom-controller/internal/dockerexec"
)
// TestMain puts a silent docker stub on PATH for every test in this package: R-650, the fixtures
// here build a real stacks.Manager, and on the build host (DooPlex) that reached production Docker.
//
// R-751: the retention after an update or a remove runs in a GOROUTINE that outlives the test that triggered it — it
// wrote into a test's temp dir while the dir was being removed ("directory not empty") and once panicked on the
// vanished stack. No test here may leave one running: both seams are no-ops by default; the retention tests call
// RetainImagesAfter* directly, and the wiring tests swap the seams themselves.
func TestMain(m *testing.M) {
retainAfterUpdateFn = func(*Manager, string, map[string]InstalledImage) {}
retainAfterRemoveFn = func(*Manager, string, map[string]bool) {}
os.Exit(dockerexec.RunWithStub(m))
}