created neo4j+boltdb dev environment harness

This commit is contained in:
jay
2026-11-22 12:27:05 -05:00
parent 7ae7a632f3
commit 54f3f81add
3 changed files with 79 additions and 6 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ import (
"testing"
)
func tempDB(t *testing.T) *bolt.DB {
func newBoltStore(t *testing.T) *bolt.DB {
path := filepath.Join(t.TempDir(), "test.db")
db, err := bolt.Open(path, 0600, nil)
require.NoError(t, err)
@@ -17,7 +17,7 @@ func tempDB(t *testing.T) *bolt.DB {
}
func TestSetupBoltDB(t *testing.T) {
db := tempDB(t)
db := newBoltStore(t)
err := SetupBoltDB(db)
assert.NoError(t, err)
@@ -89,7 +89,7 @@ func TestBatchCheckEventsExist(t *testing.T) {
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
db := tempDB(t)
db := newBoltStore(t)
if !tc.skipSetup {
err := SetupBoltDB(db)
@@ -149,7 +149,7 @@ func TestBatchWriteEvents(t *testing.T) {
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
db := tempDB(t)
db := newBoltStore(t)
err := SetupBoltDB(db)
require.NoError(t, err)
@@ -171,7 +171,7 @@ func TestBatchWriteEvents(t *testing.T) {
}
func TestWriteThenCheck(t *testing.T) {
db := tempDB(t)
db := newBoltStore(t)
err := SetupBoltDB(db)
require.NoError(t, err)