This repository has been archived by the owner on Oct 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Test review apps. #273
Draft
prescod
wants to merge
13
commits into
master
Choose a base branch
from
review-apps
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Test review apps. #273
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
605b2df
Test review apps.
140ba22
Another attempt at review apps
47ee5fc
Attempt to fix dyno type.
6c2d684
Next step with review apps
45c6be8
Fix typo
e5dacaf
Permissions
2796867
Updates to environment variables etc.
a14b17f
Point to correct requirements.txt file.
0653767
Remove reference to debug_toolbar
996984b
Remove django-extensions dependency
13020e2
Try to get pytest to use provided Postgres
9127496
Add missnig import
231b1ff
Add documentation about conftest.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
release: python manage.py migrate --noinput | ||
release: utility/heroku-release.sh | ||
web: gunicorn config.wsgi:application | ||
worker: python manage.py rqworker default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import pytest | ||
import environ | ||
from django.conf import settings | ||
|
||
# this recipe convinces pytest-sjango to use the pre-existing | ||
# database instead of creating a new one. Heroku apps seem | ||
# to not have permissions to create databases on the fly. | ||
|
||
# https://pytest-django.readthedocs.io/en/latest/database.html#using-an-existing-external-database-for-tests | ||
|
||
if os.environ.get("HEROKU_APP_NAME", "").startswith("sfdoc-review-apps-"): | ||
env = environ.Env() | ||
@pytest.fixture(scope='session') | ||
def django_db_setup(): | ||
settings.DATABASES['default'] = env.db("DATABASE_URL") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
|
||
if os.environ.get("HEROKU_APP_NAME", "").startswith("sfdoc-review-apps-"): | ||
assert not os.system("pip install --upgrade -r requirements/test.txt") | ||
os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.integration_tests" | ||
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. you could use the I'll leave this up to you but it seems a bit silly to have heroku-release.sh call into Python just to shell back out to run other commands... |
||
assert not os.system("pytest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
python manage.py migrate --noinput | ||
python utility/heroku-release.py |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's this for?
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.
I added a clarifying comment in 231b1ff.