MCPcopy Create free account
hub / github.com/actions/actions-runner-controller / TestRemoveRunner

Function TestRemoveRunner

github/github_test.go:105–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestRemoveRunner(t *testing.T) {
106 tests := []struct {
107 enterprise string
108 org string
109 repo string
110 err bool
111 }{
112 {enterprise: "", org: "", repo: "test/valid", err: false},
113 {enterprise: "", org: "", repo: "test/invalid", err: true},
114 {enterprise: "", org: "", repo: "test/error", err: true},
115 {enterprise: "", org: "test", repo: "", err: false},
116 {enterprise: "", org: "invalid", repo: "", err: true},
117 {enterprise: "", org: "error", repo: "", err: true},
118 {enterprise: "test", org: "", repo: "", err: false},
119 {enterprise: "invalid", org: "", repo: "", err: true},
120 {enterprise: "error", org: "", repo: "", err: true},
121 }
122
123 client := newTestClient()
124 for i, tt := range tests {
125 err := client.RemoveRunner(context.Background(), tt.enterprise, tt.org, tt.repo, int64(1))
126 if !tt.err && err != nil {
127 t.Errorf("[%d] unexpected error: %v", i, err)
128 }
129 }
130}
131
132func TestCleanup(t *testing.T) {
133 token := "token"

Callers

nothing calls this directly

Calls 3

newTestClientFunction · 0.85
RemoveRunnerMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected