-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add JobGet + JobGetTx methods to Client, use within tests #186
Conversation
Lol, messed up my commits, fixing. |
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.
Looks great!
Should we cut a new release after merging this one? We may not ship anything else interesting for another week or two.
|
||
client, _ := setup(t) | ||
|
||
job, err := client.JobGet(ctx, 999999) |
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.
Hah, very unlikely, but small chance this fails locally because our test DB sequences don't get reset between runs. Probably will never happen, but I guess zero might be a slighter safer alternative.
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.
Should only be an issue if a row actually exists with this ID, right? And we either truncate after each test or use a txn that gets rolled back.
I don't think so quite yet. I will have another new API up soon (something like |
This adds some basic APIs for fetching a single job from the database. I updated all the tests in
client_test.go
to use it, except for some lower level ones that were using dbsqlc types and didn't seem worth converting.