What changed, and why it matters
This commit only adds a test-only helper variable (isSQLDB) to three test setup files. It does not change any production code, network behavior, or security-sensitive logic. There is no security issue here.
No action required. This is a benign test infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds a package-level boolean variable isSQLDB set to false in the KV test build and true in the Postgres/SQLite test builds. It is intended for use in tests to branch based on the active backend. No runtime or security-relevant code is modified.
Changed components
graph/db/test_kvdb.gograph/db/test_postgres.gograph/db/test_sqlite.goInspect captured patch +9 / −0
diff --git a/graph/db/test_kvdb.go b/graph/db/test_kvdb.go
index 569e094..22904f8 100644
--- a/graph/db/test_kvdb.go
+++ b/graph/db/test_kvdb.go
@@ -9,6 +9,9 @@ import (
"github.com/stretchr/testify/require"
)
+// isSQLDB indicates that this build does not use a SQL database.
+var isSQLDB = false
+
// NewTestDB is a helper function that creates an BBolt database for testing.
func NewTestDB(t testing.TB) Store {
backend, backendCleanup, err := kvdb.GetTestBackend(t.TempDir(), "cgr")
diff --git a/graph/db/test_postgres.go b/graph/db/test_postgres.go
index 716210a..a1bd61a 100644
--- a/graph/db/test_postgres.go
+++ b/graph/db/test_postgres.go
@@ -11,6 +11,9 @@ import (
"github.com/stretchr/testify/require"
)
+// isSQLDB indicates that this build uses a SQL database.
+var isSQLDB = true
+
// NewTestDB is a helper function that creates a SQLStore backed by a SQL
// database for testing.
func NewTestDB(t testing.TB) Store {
diff --git a/graph/db/test_sqlite.go b/graph/db/test_sqlite.go
index 68fef6e..137ab7a 100644
--- a/graph/db/test_sqlite.go
+++ b/graph/db/test_sqlite.go
@@ -11,6 +11,9 @@ import (
"github.com/stretchr/testify/require"
)
+// isSQLDB indicates that this build uses a SQL database.
+var isSQLDB = true
+
// NewTestDB is a helper function that creates a SQLStore backed by a SQL
// database for testing.
func NewTestDB(t testing.TB) Store {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.