File: helpers_cache_archiver_test.go

package info (click to toggle)
gitlab-ci-multi-runner 14.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,248 kB
  • sloc: sh: 1,694; makefile: 384; asm: 79; ruby: 68
file content (27 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Helper functions that are shared between unit tests and integration tests

package helpers

import (
	"time"

	"gocloud.dev/blob"
)

// NewCacheArchiverCommandForTest exposes CacheArchiverCommand with fileArchiver to integration tests
func NewCacheArchiverCommandForTest(file string, fileArchiverPaths []string) CacheArchiverCommand {
	return CacheArchiverCommand{
		File:         file,
		fileArchiver: fileArchiver{Paths: fileArchiverPaths},
	}
}

// SetCacheArchiverCommandMux allows integration tests to set mux
func SetCacheArchiverCommandMux(cmd *CacheArchiverCommand, mux *blob.URLMux) {
	cmd.mux = mux
}

// SetCacheArchiverCommandClientTimeout allows integration tests to set the client timeout
func SetCacheArchiverCommandClientTimeout(cmd *CacheArchiverCommand, timeout time.Duration) {
	cmd.getClient().Timeout = timeout
}