-
Notifications
You must be signed in to change notification settings - Fork 2
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
Give tests their own database #294
Conversation
4b90cc3
to
46cbad2
Compare
46cbad2
to
b93bb3c
Compare
b93bb3c
to
b478e9c
Compare
64e1708
to
aeedd5e
Compare
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.
Please resolve the conflicts :)
f"Database '{conf.postgres.db}' is not empty. The tests will only run given a database without any tables in it." | ||
) | ||
exit(1) | ||
|
||
run_required_migrations() | ||
startup(reset_data=True) |
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.
Just noticed that this will wipe all project files, which is inconvenient when running the tests during development :(
I'd solve this by adding a call to mktemp
in the new makefile, and setting REPO_ROOT
to that folder.
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.
Fixed in the makefile PR: 1628004
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.
finde ich gut, d.h. aber dass wir Tests jetzt ausschließlich über das makefile starten sollten. wird beim makefile automatisch source .env; source .env.testing ausgeführt?
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.
Guter Punkt, .env.testing
hat noch gefehlt. Hab's jetzt eingefügt.
aeedd5e
to
3a26891
Compare
@@ -9,6 +9,10 @@ on: | |||
jobs: | |||
check-schema: | |||
runs-on: ubuntu-latest | |||
env: | |||
API_PRODUCTION_WORKERS: 0 |
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.
was bedeutet denn API_PRODUCTION_WORKERS: 0? Muss das nicht mindestens 1 sein? Vorher war es auch auf 0 gesetzt, von daher ist es wahrscheinlich richtig so.
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.
Ich glaube, wir könnten den Wert aus der CI eigentlich ganz rausnehmen. Der Wert wird komplett ignoriert, wenn API_PRODUCTION_MODE
nicht auf 1
gesetzt ist. Deswegen stehen da so sinnlose sachen wie 0
oder an anderer Stelle -10
drin.
3a26891
to
c895afd
Compare
Fix #283