File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -465,26 +465,37 @@ func Test_CustomBinariesLocation(t *testing.T) {
465465}
466466
467467func Test_PrefetchedBinaries (t * testing.T ) {
468- tempDir , err := ioutil .TempDir ("" , "prepare_database_test" )
468+ binTempDir , err := ioutil .TempDir ("" , "prepare_database_test_bin" )
469+ if err != nil {
470+ panic (err )
471+ }
472+
473+ runtimeTempDir , err := ioutil .TempDir ("" , "prepare_database_test_runtime" )
469474 if err != nil {
470475 panic (err )
471476 }
472477
473478 defer func () {
474- if err := os .RemoveAll (tempDir ); err != nil {
479+ if err := os .RemoveAll (binTempDir ); err != nil {
480+ panic (err )
481+ }
482+
483+ if err := os .RemoveAll (runtimeTempDir ); err != nil {
475484 panic (err )
476485 }
477486 }()
478487
479- database := NewDatabase (DefaultConfig ().BinariesPath (tempDir ))
488+ database := NewDatabase (DefaultConfig ().
489+ BinariesPath (binTempDir ).
490+ RuntimePath (runtimeTempDir ))
480491
481492 // Download and unarchive postgres into the bindir.
482493 if err := database .remoteFetchStrategy (); err != nil {
483494 panic (err )
484495 }
485496
486497 cacheLocation , _ := database .cacheLocator ()
487- if err := archiver .NewTarXz ().Unarchive (cacheLocation , tempDir ); err != nil {
498+ if err := archiver .NewTarXz ().Unarchive (cacheLocation , binTempDir ); err != nil {
488499 panic (err )
489500 }
490501
You can’t perform that action at this time.
0 commit comments