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

Function TestConfigure_PkgCacheCacheArtifacts

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

Source from the content-addressed store, hash-verified

889}
890
891func TestConfigure_PkgCacheCacheArtifacts(t *testing.T) {
892 celer := newInitializedCeler(t)
893
894 // Must create cache dir before setting cache dir; --pkgcache-cache-artifacts
895 // requires that the pkgcache dir is already configured (same group, runs in
896 // one command).
897 if err := os.MkdirAll(dirs.TestPkgCacheDir, os.ModePerm); err != nil {
898 t.Fatal(err)
899 }
900 cmd := &configureCmd{}
901 if _, err := runCommand(t, cmd.Command(celer),
902 "--pkgcache-dir="+dirs.TestPkgCacheDir,
903 "--pkgcache-cache-artifacts=true",
904 ); err != nil {
905 t.Fatal(err)
906 }
907
908 celer2 := configs.NewCeler()
909 if err := celer2.Init(); err != nil {
910 t.Fatal(err)
911 }
912 if !celer2.PkgCacheConfig().GetCacheArtifacts() {
913 t.Fatal("pkgcache cache-artifacts should be `true`")
914 }
915}
916
917func TestConfigure_PkgCacheCacheDownloads(t *testing.T) {
918 celer := newInitializedCeler(t)

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
GetCacheArtifactsMethod · 0.65

Tested by

no test coverage detected