MCPcopy Create free account
hub / github.com/cloudbase/garm / TestGetRunnerInstallScript

Method TestGetRunnerInstallScript

runner/metadata_test.go:303–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301}
302
303func (s *MetadataTestSuite) TestGetRunnerInstallScript() {
304 // Set up github tools cache for the entity
305 tools := []commonParams.RunnerApplicationDownload{
306 {
307 OS: garmTesting.Ptr("linux"),
308 Architecture: garmTesting.Ptr("x64"),
309 DownloadURL: garmTesting.Ptr("https://example.com/actions-runner-linux-x64-2.0.0.tar.gz"),
310 Filename: garmTesting.Ptr("actions-runner-linux-x64-2.0.0.tar.gz"),
311 SHA256Checksum: garmTesting.Ptr("abc123"),
312 },
313 }
314 cache.SetGithubToolsCache(s.Fixtures.TestEntity, tools)
315
316 script, err := s.Runner.GetRunnerInstallScript(s.instanceCtx)
317
318 s.Require().Nil(err)
319 s.Require().NotEmpty(script)
320 // Should contain the template content
321 s.Require().Contains(string(script), "Installing runner")
322}
323
324func (s *MetadataTestSuite) TestGetRunnerInstallScriptUnauthorized() {
325 _, err := s.Runner.GetRunnerInstallScript(s.unauthorizedCtx)

Callers

nothing calls this directly

Calls 2

SetGithubToolsCacheFunction · 0.92

Tested by

no test coverage detected