What changed, and why it matters
This commit simply renames two test helper files from ending in '_test.go' to starting with 'test_'. The code inside the files is unchanged. It is a routine cleanup to make the file names better describe that these files contain helper utilities for tests, not actual tests. There is no security relevance.
No action required. This is a non-security refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes ‘sqldb/v2/postgres_test.go’ and ‘sqldb/v2/sqlite_test.go’ and creates ‘sqldb/v2/test_postgres.go’ and ‘sqldb/v2/test_sqlite.go’ with identical content. The build tags (‘test_db_postgres’ and ‘!test_db_postgres’) and all function definitions remain the same. This is a pure file rename with no functional or security changes.
Changed components
sqldb/v2/postgres_test.gosqldb/v2/sqlite_test.gosqldb/v2/test_postgres.gosqldb/v2/test_sqlite.goInspect captured patch +50 / −50
diff --git a/sqldb/v2/postgres_test.go b/sqldb/v2/postgres_test.go
deleted file mode 100644
index 6557512..0000000
--- a/sqldb/v2/postgres_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-//go:build test_db_postgres
-
-package sqldb
-
-import (
- "testing"
-)
-
-// NewTestDB is a helper function that creates a Postgres database for testing.
-func NewTestDB(t *testing.T, sets []MigrationSet) *PostgresStore {
- pgFixture := NewTestPgFixture(t, DefaultPostgresFixtureLifetime)
- t.Cleanup(func() {
- pgFixture.TearDown(t)
- })
-
- return NewTestPostgresDB(t, pgFixture, sets)
-}
-
-// NewTestDBWithVersion is a helper function that creates a Postgres database
-// for testing and migrates it to the given version.
-func NewTestDBWithVersion(t *testing.T, version uint,
- set MigrationSet) *PostgresStore {
-
- pgFixture := NewTestPgFixture(t, DefaultPostgresFixtureLifetime)
- t.Cleanup(func() {
- pgFixture.TearDown(t)
- })
-
- return NewTestPostgresDBWithVersion(t, pgFixture, set, version)
-}
diff --git a/sqldb/v2/sqlite_test.go b/sqldb/v2/sqlite_test.go
deleted file mode 100644
index 6105080..0000000
--- a/sqldb/v2/sqlite_test.go
+++ /dev/null
@@ -1,20 +0,0 @@
-//go:build !test_db_postgres
-
-package sqldb
-
-import (
- "testing"
-)
-
-// NewTestDB is a helper function that creates an SQLite database for testing.
-func NewTestDB(t *testing.T, sets []MigrationSet) *SqliteStore {
- return NewTestSqliteDB(t, sets)
-}
-
-// NewTestDBWithVersion is a helper function that creates an SQLite database
-// for testing and migrates it to the given version.
-func NewTestDBWithVersion(t *testing.T, set MigrationSet,
- version uint) *SqliteStore {
-
- return NewTestSqliteDBWithVersion(t, set, version)
-}
diff --git a/sqldb/v2/test_postgres.go b/sqldb/v2/test_postgres.go
new file mode 100644
index 0000000..6557512
--- /dev/null
+++ b/sqldb/v2/test_postgres.go
@@ -0,0 +1,30 @@
+//go:build test_db_postgres
+
+package sqldb
+
+import (
+ "testing"
+)
+
+// NewTestDB is a helper function that creates a Postgres database for testing.
+func NewTestDB(t *testing.T, sets []MigrationSet) *PostgresStore {
+ pgFixture := NewTestPgFixture(t, DefaultPostgresFixtureLifetime)
+ t.Cleanup(func() {
+ pgFixture.TearDown(t)
+ })
+
+ return NewTestPostgresDB(t, pgFixture, sets)
+}
+
+// NewTestDBWithVersion is a helper function that creates a Postgres database
+// for testing and migrates it to the given version.
+func NewTestDBWithVersion(t *testing.T, version uint,
+ set MigrationSet) *PostgresStore {
+
+ pgFixture := NewTestPgFixture(t, DefaultPostgresFixtureLifetime)
+ t.Cleanup(func() {
+ pgFixture.TearDown(t)
+ })
+
+ return NewTestPostgresDBWithVersion(t, pgFixture, set, version)
+}
diff --git a/sqldb/v2/test_sqlite.go b/sqldb/v2/test_sqlite.go
new file mode 100644
index 0000000..6105080
--- /dev/null
+++ b/sqldb/v2/test_sqlite.go
@@ -0,0 +1,20 @@
+//go:build !test_db_postgres
+
+package sqldb
+
+import (
+ "testing"
+)
+
+// NewTestDB is a helper function that creates an SQLite database for testing.
+func NewTestDB(t *testing.T, sets []MigrationSet) *SqliteStore {
+ return NewTestSqliteDB(t, sets)
+}
+
+// NewTestDBWithVersion is a helper function that creates an SQLite database
+// for testing and migrates it to the given version.
+func NewTestDBWithVersion(t *testing.T, set MigrationSet,
+ version uint) *SqliteStore {
+
+ return NewTestSqliteDBWithVersion(t, set, version)
+}
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.