-
Notifications
You must be signed in to change notification settings - Fork 34
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
AUT-350 - Adding more permissions for unit test database container. #1058
Conversation
Oh, I just approved it, but could we change our handlers_test.go to do this truncate before the test runs? I think we need to do that anyway, but would also demonstrate the problem is solved. Or we could panic in Cleanup or something |
I could be told nah, tho. We can do it as follow ups |
You wanna merge this or are you thinking about doing that work? (I would like to post my PR that uses this work to require a database in contentsignaturepki) |
Hrm, I'm not seeing this allow me to use |
To double check myself, I made this change.
And then ran:
And it worked fine for me. Wanna pair tomorrow? |
I missed this comment in reply to me! I apologize for the delay. Let me investigate my situation. Perhaps the same problem that caused my debian GPG problems also caused my local problem. |
It was PEBKAC! I had left in code using a different user |
AUT-350
Problem: When unit tests run, they fail to truncate the database table as the postgres user account doesn't have permission to do that. But it fails silently without an explicit
Fatalf
call, so we didn't realize.This solution: We mount an additional initdb file for the database container in docker-compose. This means we don't include it in the Dockerfile or modify
schema.sql
so it's clear that this is for unit tests only.Other solutions:
schema.sql
- This could grant our user account more permissions than intended if somebody runs it without checking.