featurebase/dax/test/schemar.go
Travis Turner 20429bb9dc
Remove MDS and replace it with Controller (#2219)
* Remove MDS and replace it with Controller

This commit removes the MDS layer (and package) and shifts Controller
package into its place.

* add pprof/fgprof to serverless http router

---------

Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
2023-01-30 16:54:12 -06:00

29 lines
810 B
Go

package test
import (
"os"
"testing"
"github.com/featurebasedb/featurebase/v3/dax/boltdb"
"github.com/featurebasedb/featurebase/v3/dax/controller/schemar"
schemarbolt "github.com/featurebasedb/featurebase/v3/dax/controller/schemar/boltdb"
testbolt "github.com/featurebasedb/featurebase/v3/dax/test/boltdb"
"github.com/featurebasedb/featurebase/v3/logger"
)
func NewSchemar(t *testing.T) (schemar schemar.Schemar, cleanup func()) {
td, err := os.MkdirTemp("", "schemartest_*")
if err != nil {
t.Fatalf(": %v", err)
}
db, err := boltdb.NewSvcBolt(td, "schemar", schemarbolt.SchemarBuckets...)
if err != nil {
t.Fatalf("opening boltdb: %v", err)
}
s := schemarbolt.NewSchemar(db, logger.StderrLogger)
return s, func() {
testbolt.MustCloseDB(t, db)
testbolt.CleanupDB(t, db.Path())
}
}