Skip to content

Commit

Permalink
storage/interop/protocol: use rocksdb backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Nov 2, 2023
1 parent 376cedd commit 41b7376
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .buildkite/go/test_and_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,27 @@ download_artifact simple-keyvalue target/debug 755

export OASIS_TEST_RUNTIME_HOST_RUNTIME_PATH=$(pwd)/target/debug/simple-keyvalue

TAGS="jemalloc,rocksdb,grocksdb_clean_link"
#####################
# Test the Oasis node
#####################
pushd go
make generate
# We need to do multiple test passes for different parts to get correct coverage.
env -u GOPATH go test -race -coverprofile=../coverage-misc.txt -covermode=atomic -v \
env -u GOPATH go test -tags "${TAGS}" -race -coverprofile=../coverage-misc.txt -covermode=atomic -v \
$(go list ./... | \
grep -v github.com/oasisprotocol/oasis-core/go/oasis-node | \
grep -v github.com/oasisprotocol/oasis-core/go/genesis | \
grep -v github.com/oasisprotocol/oasis-core/go/storage/mkvs )
# Oasis node tests.
pushd oasis-node
env -u GOPATH go test -race -coverpkg ../... -coverprofile=../../coverage-oasis-node.txt -covermode=atomic -v ./...
env -u GOPATH go test -tags "${TAGS}" -race -coverpkg ../... -coverprofile=../../coverage-oasis-node.txt -covermode=atomic -v ./...
popd
pushd genesis
env -u GOPATH go test -race -coverpkg ../... -coverprofile=../../coverage-genesis.txt -covermode=atomic -v ./...
env -u GOPATH go test -tags "${TAGS}" -race -coverpkg ../... -coverprofile=../../coverage-genesis.txt -covermode=atomic -v ./...
popd
# MKVS tests.
pushd storage/mkvs
env -u GOPATH go test -race -coverpkg ./... -coverprofile=../../../coverage-mkvs.txt -covermode=atomic -v ./...
env -u GOPATH go test -tags "${TAGS}" -race -coverpkg ./... -coverprofile=../../../coverage-mkvs.txt -covermode=atomic -v ./...
popd
popd
1 change: 0 additions & 1 deletion go/storage/mkvs/db/rocksdb/rocksdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ func verifyNodes(require *require.Assertions, rocksdb *rocksdbNodeDB, version ui
continue
}
_, ok := keySet[string(key)]
fmt.Println(key)
require.Equal(true, ok, "unexpected node in db")
delete(notVisited, string(key))
}
Expand Down
6 changes: 3 additions & 3 deletions go/storage/mkvs/interop/cmd/protocol_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/oasisprotocol/oasis-core/go/oasis-node/cmd/common/background"
"github.com/oasisprotocol/oasis-core/go/storage/api"
"github.com/oasisprotocol/oasis-core/go/storage/database"
badgerNodedb "github.com/oasisprotocol/oasis-core/go/storage/mkvs/db/badger"
"github.com/oasisprotocol/oasis-core/go/storage/mkvs/db/rocksdb"
"github.com/oasisprotocol/oasis-core/go/storage/mkvs/interop/fixtures"
"github.com/oasisprotocol/oasis-core/go/storage/mkvs/node"
)
Expand Down Expand Up @@ -68,7 +68,7 @@ func doProtoServer(*cobra.Command, []string) {

// Initialize a dummy storage backend.
storageCfg := api.Config{
Backend: database.BackendNameBadgerDB,
Backend: database.BackendNameRocksDB,
DB: dataDir,
MaxCacheSize: 16 * 1024 * 1024,
}
Expand All @@ -77,7 +77,7 @@ func doProtoServer(*cobra.Command, []string) {
ctx := context.Background()
ndbCfg := storageCfg.ToNodeDB()
var ndb api.NodeDB
ndb, err = badgerNodedb.New(ndbCfg)
ndb, err = rocksdb.New(ndbCfg)
if err != nil {
logger.Error("failed to initialize node db",
"err", err,
Expand Down

0 comments on commit 41b7376

Please sign in to comment.