Skip to content

Commit

Permalink
refactor: remove piece directory couchbase tests (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and LexLuthr committed Jul 20, 2023
1 parent 5e30391 commit 7ca9acb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
32 changes: 0 additions & 32 deletions piecedirectory/doctor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/filecoin-project/boost/testutil"
"github.com/filecoin-project/boostd-data/client"
"github.com/filecoin-project/boostd-data/couchbase"
"github.com/filecoin-project/boostd-data/ldb"
"github.com/filecoin-project/boostd-data/model"
"github.com/filecoin-project/boostd-data/svc"
Expand Down Expand Up @@ -60,37 +59,6 @@ func TestPieceDoctor(t *testing.T) {
ldb.MinPieceCheckPeriod = prev
})

t.Run("couchbase", func(t *testing.T) {
// TODO: Unskip this test once the couchbase instance can be created
// from a docker container in CI
t.Skip()

prev := couchbase.MinPieceCheckPeriod
couchbase.MinPieceCheckPeriod = 1 * time.Second

svc.SetupCouchbase(t, testCouchSettings)
bdsvc := svc.NewCouchbase(testCouchSettings)

addr := "localhost:8051"
err := bdsvc.Start(ctx, addr)
require.NoError(t, err)

cl := client.NewStore()
err = cl.Dial(ctx, fmt.Sprintf("ws://%s", addr))
require.NoError(t, err)
defer cl.Close(ctx)

t.Run("next pieces", func(t *testing.T) {
testNextPieces(ctx, t, cl, couchbase.MinPieceCheckPeriod)
})

t.Run("check pieces", func(t *testing.T) {
testCheckPieces(ctx, t, cl)
})

couchbase.MinPieceCheckPeriod = prev
})

t.Run("yugabyte", func(t *testing.T) {
prev := yugabyte.MinPieceCheckPeriod
yugabyte.MinPieceCheckPeriod = 1 * time.Second
Expand Down
28 changes: 0 additions & 28 deletions piecedirectory/piecedirectory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ import (
"github.com/stretchr/testify/require"
)

var testCouchSettings = couchbase.DBSettings{
ConnectString: "couchbase://localhost",
Auth: couchbase.DBSettingsAuth{
Username: "Administrator",
Password: "boostdemo",
},
PieceMetadataBucket: couchbase.DBSettingsBucket{
RAMQuotaMB: 128,
},
MultihashToPiecesBucket: couchbase.DBSettingsBucket{
RAMQuotaMB: 128,
},
PieceOffsetsBucket: couchbase.DBSettingsBucket{
RAMQuotaMB: 128,
},
TestMode: true,
}

func TestPieceDirectory(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 300*time.Second)
defer cancel()
Expand All @@ -55,16 +37,6 @@ func TestPieceDirectory(t *testing.T) {
testPieceDirectory(ctx, t, bdsvc, addr)
})

t.Run("couchbase", func(t *testing.T) {
// TODO: Unskip this test once the couchbase instance can be created
// from a docker container in CI as part of the test
t.Skip()
svc.SetupCouchbase(t, testCouchSettings)
bdsvc := svc.NewCouchbase(testCouchSettings)
addr := "localhost:8043"
testPieceDirectory(ctx, t, bdsvc, addr)
})

t.Run("yugabyte", func(t *testing.T) {
svc.SetupYugabyte(t)

Expand Down

0 comments on commit 7ca9acb

Please sign in to comment.