Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comments
  • Loading branch information
AbhineetJain committed Jun 16, 2022
commit 345d1161f7dbd133b3e81a70ce754f517d8e4ce5
1 change: 1 addition & 0 deletions coderd/coderdtest/coderdtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func New(t *testing.T, options *Options) *codersdk.Client {
return client
}

// UseSQL returns true if a Postgres server is running and can be used for tests.
func UseSQL() bool {
return os.Getenv("DB") != ""
}
Expand Down
1 change: 1 addition & 0 deletions coderd/database/querier.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/queries/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LIMIT
1;

-- name: GetActualUserCount :one
-- Actual user count refers to the count of all users except the system user
SELECT
COUNT(*)
FROM
Expand Down
2 changes: 1 addition & 1 deletion coderd/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

func TestSystemUser(t *testing.T) {
if !coderdtest.UseSQL() {
t.Skip("There is no point in running this test.")
t.Skip("This test asserts that the system user is equivalent in SQL and the fake database.")
}

t.Parallel()
Expand Down