@@ -138,12 +138,18 @@ spec = Spec.around withTempDir do
138138 writeConfigWithEither testCwd
139139 spago [ " install" , " --offline" , " either" ] >>= shouldBeFailureErr (fixture " offline.txt" )
140140
141- Spec .it " forces registry refresh when using --refresh flag " \{ spago } -> do
141+ Spec .it " refresh flag forces registry refresh and bypasses DB metadata cache " \{ spago, testCwd } -> do
142142 spago [ " init" ] >>= shouldBeSuccess
143143 -- The --refresh flag should force a registry refresh regardless of cache age
144- result <- spago [ " install" , " --refresh" ]
145- shouldBeSuccess result
146- either _.stderr _.stderr result `shouldContain` " Refreshing the Registry Index..."
144+ result1 <- spago [ " install" , " --refresh" ]
145+ shouldBeSuccess result1
146+ either _.stderr _.stderr result1 `shouldContain` " Refreshing the Registry Index..."
147+ -- Remove lockfile to force dependency resolution on next install
148+ FS .unlink (testCwd </> " spago.lock" )
149+ -- With --refresh, should also bypass DB metadata cache and read from files
150+ result2 <- spago [ " install" , " -v" , " --refresh" , " effect" ]
151+ shouldBeSuccess result2
152+ either _.stderr _.stderr result2 `shouldContain` " Bypassing cache, reading metadata from file"
147153
148154 Spec .it " skips cloning during resolution when git package has declared deps" \{ spago, testCwd, fixture } -> do
149155 FS .copyFile { src: fixture " git-declared-deps/with-declared-deps.yaml" , dst: testCwd </> " spago.yaml" }
0 commit comments