()
| 619 | } |
| 620 | |
| 621 | func (s *MetadataTestSuite) TestGetInstanceMetadata() { |
| 622 | // Set up github tools cache for the entity |
| 623 | tools := []commonParams.RunnerApplicationDownload{ |
| 624 | { |
| 625 | OS: garmTesting.Ptr("linux"), |
| 626 | Architecture: garmTesting.Ptr("x64"), |
| 627 | DownloadURL: garmTesting.Ptr("https://example.com/actions-runner-linux-x64-2.0.0.tar.gz"), |
| 628 | Filename: garmTesting.Ptr("actions-runner-linux-x64-2.0.0.tar.gz"), |
| 629 | SHA256Checksum: garmTesting.Ptr("abc123"), |
| 630 | }, |
| 631 | } |
| 632 | cache.SetGithubToolsCache(s.Fixtures.TestEntity, tools) |
| 633 | |
| 634 | metadata, err := s.Runner.GetInstanceMetadata(s.instanceCtx) |
| 635 | |
| 636 | s.Require().Nil(err) |
| 637 | s.Require().NotEmpty(metadata.RunnerName) |
| 638 | s.Require().Equal(s.Fixtures.TestInstance.Name, metadata.RunnerName) |
| 639 | s.Require().Equal(params.GithubEndpointType, metadata.ForgeType) |
| 640 | s.Require().False(metadata.JITEnabled) |
| 641 | s.Require().False(metadata.AgentMode) |
| 642 | s.Require().NotNil(metadata.RunnerTools) |
| 643 | // Metadata access details are populated from instance |
| 644 | s.Require().NotNil(metadata.MetadataAccess) |
| 645 | } |
| 646 | |
| 647 | func (s *MetadataTestSuite) TestGetInstanceMetadataUnauthorized() { |
| 648 | _, err := s.Runner.GetInstanceMetadata(s.unauthorizedCtx) |
nothing calls this directly
no test coverage detected