(t *testing.T)
| 915 | } |
| 916 | |
| 917 | func 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 |
nothing calls this directly
no test coverage detected