MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestCCache_Setup_Disabled

Function TestCCache_Setup_Disabled

configs/ccache_test.go:32–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestCCache_Setup_Disabled(t *testing.T) {
33 disable, _ := os.LookupEnv("CCACHE_DISABLE")
34 defer func() {
35 if disable != "" {
36 os.Setenv("CCACHE_DISABLE", disable)
37 } else {
38 os.Unsetenv("CCACHE_DISABLE")
39 }
40 }()
41
42 dir := t.TempDir()
43 ccache := &CCache{Enabled: false, Dir: dir}
44
45 if err := ccache.Setup(); err != nil {
46 t.Fatalf("Setup() error = %v", err)
47 }
48
49 if v := os.Getenv("CCACHE_DISABLE"); v != "1" {
50 t.Errorf("CCACHE_DISABLE = %q, want 1", v)
51 }
52}
53
54func TestCCache_Setup_RemoteStorage(t *testing.T) {
55 keys := []string{"CCACHE_REMOTE_STORAGE", "CCACHE_REMOTE_ONLY"}

Callers

nothing calls this directly

Calls 1

SetupMethod · 0.95

Tested by

no test coverage detected