Documentation ¶
Index ¶
- func AssertEqualDirectories(t *testing.T, dir1, dir2 string)
- func AssertEqualFiles(t *testing.T, file1, file2 string)
- func ReadFile(t *testing.T, path string) string
- type HelperSuite
- func (s *HelperSuite) DeleteObjects(prefix string)
- func (s *HelperSuite) Destroy()
- func (s *HelperSuite) GetClient() *s3helper.ClientWrapper
- func (s *HelperSuite) GetResult(published *models.SpecConfig) string
- func (s *HelperSuite) HasValidCredentials() bool
- func (s *HelperSuite) PrepareAndPublish(compressed bool) (models.SpecConfig, string)
- func (s *HelperSuite) PreparePublisherSpec(compressed bool) s3helper.PublisherSpec
- func (s *HelperSuite) PrepareResultsPath() string
- func (s *HelperSuite) PublishResult(publisherConfig s3helper.PublisherSpec, resultPath string) (models.SpecConfig, error)
- func (s *HelperSuite) PublishResultSilently(publisherConfig s3helper.PublisherSpec, resultPath string) models.SpecConfig
- func (s *HelperSuite) SetupSuite()
- type HelperSuiteParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqualDirectories ¶
AssertEqualDirectories recursively compares two directories
func AssertEqualFiles ¶
AssertEqualFiles checks if two files are identical by comparing their SHA-256 hashes
Types ¶
type HelperSuite ¶
type HelperSuite struct { suite.Suite // Fields that are initialized once in the constructor Bucket string Region string Endpoint string BasePrefix string ClientProvider *s3helper.ClientProvider Publisher *s3publisher.Publisher Storage *s3storage.StorageProvider // Fields that are initialized in SetupSuite for every test Prefix string JobID string ExecutionID string RunID string TempDir string Ctx context.Context }
func NewTestHelper ¶
func NewTestHelper(t *testing.T, params HelperSuiteParams) *HelperSuite
func (*HelperSuite) DeleteObjects ¶
func (s *HelperSuite) DeleteObjects(prefix string)
func (*HelperSuite) Destroy ¶
func (s *HelperSuite) Destroy()
func (*HelperSuite) GetClient ¶
func (s *HelperSuite) GetClient() *s3helper.ClientWrapper
GetClient returns a client for the bucket's region and endpoint.
func (*HelperSuite) GetResult ¶
func (s *HelperSuite) GetResult(published *models.SpecConfig) string
GetResult fetches the result from S3 and returns the local path.
func (*HelperSuite) HasValidCredentials ¶
func (s *HelperSuite) HasValidCredentials() bool
HasValidCredentials returns true if the S3 client is installed.
func (*HelperSuite) PrepareAndPublish ¶
func (s *HelperSuite) PrepareAndPublish(compressed bool) (models.SpecConfig, string)
PrepareAndPublish publishes the resultPath to S3 and returns the published key.
func (*HelperSuite) PreparePublisherSpec ¶
func (s *HelperSuite) PreparePublisherSpec(compressed bool) s3helper.PublisherSpec
PreparePublisherSpec returns a publisher spec with the bucket, prefix, and endpoint.
func (*HelperSuite) PrepareResultsPath ¶
func (s *HelperSuite) PrepareResultsPath() string
PrepareResultsPath creates local directories and files that mimic a result directory structure.
func (*HelperSuite) PublishResult ¶
func (s *HelperSuite) PublishResult(publisherConfig s3helper.PublisherSpec, resultPath string) (models.SpecConfig, error)
PublishResult publishes the resultPath to S3 and returns the published key.
func (*HelperSuite) PublishResultSilently ¶
func (s *HelperSuite) PublishResultSilently(publisherConfig s3helper.PublisherSpec, resultPath string) models.SpecConfig
PublishResultSilently publishes the resultPath to S3 and skip if no access.
func (*HelperSuite) SetupSuite ¶
func (s *HelperSuite) SetupSuite()
SetupSuite creates a unique prefix for the test suite to avoid collisions.