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

Function TestConfigure_PkgCacheCacheDownloads

cmds/cmd_configure_test.go:917–938  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

915}
916
917func TestConfigure_PkgCacheCacheDownloads(t *testing.T) {
918 celer := newInitializedCeler(t)
919
920 if err := os.MkdirAll(dirs.TestPkgCacheDir, os.ModePerm); err != nil {
921 t.Fatal(err)
922 }
923 cmd := &configureCmd{}
924 if _, err := runCommand(t, cmd.Command(celer),
925 "--pkgcache-dir="+dirs.TestPkgCacheDir,
926 "--pkgcache-cache-downloads=true",
927 ); err != nil {
928 t.Fatal(err)
929 }
930
931 celer2 := configs.NewCeler()
932 if err := celer2.Init(); err != nil {
933 t.Fatal(err)
934 }
935 if !celer2.PkgCacheConfig().GetCacheDownloads() {
936 t.Fatal("pkgcache cache-downloads should be `true`")
937 }
938}
939
940// Regression: calling CacheArtifacts/CacheDownloads when PkgCache is nil
941// used to panic by dereferencing c.configData.PkgCache.Dir before checking

Callers

nothing calls this directly

Calls 8

CommandMethod · 0.95
InitMethod · 0.95
PkgCacheConfigMethod · 0.95
NewCelerFunction · 0.92
newInitializedCelerFunction · 0.85
runCommandFunction · 0.85
MkdirAllMethod · 0.80
GetCacheDownloadsMethod · 0.65

Tested by

no test coverage detected