//go:build linux package render import ( "context" "os" "path/filepath" "testing" "amadan.net/oficina/equipo/internal/release" "amadan.net/oficina/equipo/internal/wire" ) // A tree that is not there is the launch's RendererError, and the // fixture's site and output are removed again. func TestCheckFixtureRefusesAMissingTree(t *testing.T) { scratch := tempDir(t) self, err := os.Executable() if err != nil { t.Fatal(err) } pin := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" cfg := LaunchConfig{Bwrap: "/usr/bin/bwrap", Binary: self, Tree: filepath.Join(scratch, "renderer", pin[:12]), Pin: pin} err = CheckFixture(context.Background(), cfg, scratch) if release.RendererHealth(err) != wire.ToolMissing { t.Fatalf("not missing: %v", err) } if left, _ := os.ReadDir(scratch); len(left) != 0 { t.Fatalf("left in scratch: %v", left) } }