MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsCustomImageRunner

Function TestIsCustomImageRunner

pkg/workflow/runtime_setup_test.go:971–1045  ·  view source on GitHub ↗

TestIsCustomImageRunner tests detection of non-standard GitHub-hosted runners

(t *testing.T)

Source from the content-addressed store, hash-verified

969
970// TestIsCustomImageRunner tests detection of non-standard GitHub-hosted runners
971func TestIsCustomImageRunner(t *testing.T) {
972 tests := []struct {
973 name string
974 runsOn string
975 expected bool
976 }{
977 {
978 name: "empty runs-on (default ubuntu-latest applies)",
979 runsOn: "",
980 expected: false,
981 },
982 {
983 name: "ubuntu-latest is standard",
984 runsOn: "runs-on: ubuntu-latest",
985 expected: false,
986 },
987 {
988 name: "ubuntu-22.04 is standard",
989 runsOn: "runs-on: ubuntu-22.04",
990 expected: false,
991 },
992 {
993 name: "ubuntu-24.04 is standard",
994 runsOn: "runs-on: ubuntu-24.04",
995 expected: false,
996 },
997 {
998 name: "ubuntu-slim is standard",
999 runsOn: "runs-on: ubuntu-slim",
1000 expected: false,
1001 },
1002 {
1003 name: "ubuntu prefix case-insensitive",
1004 runsOn: "runs-on: Ubuntu-latest",
1005 expected: false,
1006 },
1007 {
1008 name: "windows-latest is standard",
1009 runsOn: "runs-on: windows-latest",
1010 expected: false,
1011 },
1012 {
1013 name: "windows-2022 is standard",
1014 runsOn: "runs-on: windows-2022",
1015 expected: false,
1016 },
1017 {
1018 name: "self-hosted is custom",
1019 runsOn: "runs-on: self-hosted",
1020 expected: true,
1021 },
1022 {
1023 name: "custom label is custom",
1024 runsOn: "runs-on: my-company-runner",
1025 expected: true,
1026 },
1027 {
1028 name: "array form is custom",

Callers

nothing calls this directly

Calls 2

isCustomImageRunnerFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected