-
Notifications
You must be signed in to change notification settings - Fork 1k
ci: Run tests using PostgreSQL database and mock #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e45b11e
0a0da98
3a29464
53412a2
bceaeeb
05ded12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,13 +86,14 @@ INSERT INTO | |
email, | ||
name, | ||
login_type, | ||
revoked, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem related to the ability to switch between DB / mock - but maybe needed to be updated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, this was actually a bug the DB implementation caught! |
||
hashed_password, | ||
created_at, | ||
updated_at, | ||
username | ||
) | ||
VALUES | ||
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *; | ||
($1, $2, $3, $4, false, $5, $6, $7, $8) RETURNING *; | ||
|
||
-- name: UpdateAPIKeyByID :exec | ||
UPDATE | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,7 @@ func (c *Channel) init() { | |
|
||
c.conn.dcDisconnectListeners.Add(1) | ||
c.conn.dcFailedListeners.Add(1) | ||
c.conn.dcClosedWaitGroup.Add(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch on these! Looks like a candidate for a backport to |
||
go func() { | ||
var err error | ||
// A DataChannel can disconnect multiple times, so this needs to loop. | ||
|
@@ -274,6 +275,7 @@ func (c *Channel) closeWithError(err error) error { | |
close(c.sendMore) | ||
c.conn.dcDisconnectListeners.Sub(1) | ||
c.conn.dcFailedListeners.Sub(1) | ||
c.conn.dcClosedWaitGroup.Done() | ||
|
||
if c.rwc != nil { | ||
_ = c.rwc.Close() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! It's neat that it's so easy to test both ways.
I like that we get the best of both worlds here - the mock DB seems ideal for quick iteration because it's so fast, but testing against a real PostgreSL driver is important too, but doesn't have to slow down test authoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!