MCPcopy Create free account
hub / github.com/coder/coder / PersistentCacheDir

Function PersistentCacheDir

testutil/cache.go:13–25  ·  view source on GitHub ↗

PersistentCacheDir returns a path to a directory that will be cached between test runs in Github Actions.

(t *testing.T)

Source from the content-addressed store, hash-verified

11// PersistentCacheDir returns a path to a directory
12// that will be cached between test runs in Github Actions.
13func PersistentCacheDir(t *testing.T) string {
14 t.Helper()
15
16 // We don't use os.UserCacheDir() because the path it
17 // returns is different on different operating systems.
18 // This would make it harder to specify which cache dir to use
19 // in Github Actions.
20 home, err := os.UserHomeDir()
21 require.NoError(t, err)
22 dir := filepath.Join(home, ".cache", "coderv2-test")
23
24 return dir
25}

Callers 3

downloadProvidersFunction · 0.92
TestProvisionFunction · 0.92
persistentlyCachedProxyFunction · 0.92

Calls 1

HelperMethod · 0.65

Tested by 3

downloadProvidersFunction · 0.74
TestProvisionFunction · 0.74
persistentlyCachedProxyFunction · 0.74