mirror of https://github.com/coder/coder.git
chore: avoid dbmock test errors in dbgen (#10923)
This commit is contained in:
parent
14bd489af6
commit
452668c893
|
@ -58,6 +58,7 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
|||
go run golang.org/x/tools/cmd/goimports@latest -w queries.sql.go
|
||||
|
||||
go run ../../scripts/dbgen
|
||||
# This will error if a view is broken.
|
||||
go test -run=TestViewSubset
|
||||
# This will error if a view is broken. This is in it's own package to avoid
|
||||
# stuff like dbmock breaking builds if it's out of date from the interface.
|
||||
go test ./gentest
|
||||
)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// Package gentest contains tests that are run at db generate time. These tests
|
||||
// need to exist in their own package to avoid importing stuff that gets
|
||||
// generated after the DB.
|
||||
//
|
||||
// E.g. if we put these tests in coderd/database, then we'd be importing dbmock
|
||||
// which is generated after the DB and can cause type problems when building
|
||||
// the tests.
|
||||
package gentest
|
|
@ -1,4 +1,4 @@
|
|||
package database_test
|
||||
package gentest_test
|
||||
|
||||
import (
|
||||
"reflect"
|
Loading…
Reference in New Issue