Change how static files for cypress tests are served
This commit is contained in:
parent
92fad1003b
commit
9f81082f12
|
|
@ -59,10 +59,9 @@ aliases:
|
|||
- psql -U $DATABASE_USER -h $DATABASE_HOST -c "create database $DATABASE_NAME"
|
||||
- python server/manage.py dummy_data
|
||||
- python server/manage.py runserver 2>&1 > /dev/null &
|
||||
- npm run dev --prefix client 2>&1 > /dev/null &
|
||||
- cd client
|
||||
- npm run build --prefix client
|
||||
- curl http://localhost:8000/beta-login
|
||||
- npm run test:cypress
|
||||
- npm run --prefix client test:cypress
|
||||
- &jest-test
|
||||
name: run jest tests
|
||||
caches:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ SIGNING_SECRET = os.environ.get('SIGNING_SECRET')
|
|||
DEBUG = bool_value(os.environ.get('DEBUG', ''))
|
||||
TEST = 'test' in sys.argv
|
||||
ENABLE_SILKY = bool_value(os.environ.get('ENABLE_SILKY', ''))
|
||||
SERVE_VIA_WEBPACK = bool_value(os.environ.get('SERVE_VIA_WEBPACK', DEBUG))
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class PrivateGraphQLView(LoginRequiredMixin, GraphQLView):
|
|||
|
||||
@ensure_csrf_cookie
|
||||
def home(request):
|
||||
if settings.DEBUG:
|
||||
if settings.SERVE_VIA_WEBPACK:
|
||||
try:
|
||||
return HttpResponse(requests.get('http://localhost:8080/{}'.format(request.get_full_path())).text)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
export SECRET_KEY=abcd1234
|
||||
export DATABASE_HOST=localhost
|
||||
export DATABASE_USER=postgres
|
||||
export PG_PASSWORD=postgres
|
||||
export PGPASSWORD=postgres
|
||||
export DATABASE_NAME=skillbox_test
|
||||
export DATABASE_PORT=5432
|
||||
export DATABASE_URL=postgres://$DATABASE_USER:$PG_PASSWORD@$DATABASE_HOST:$DATABASE_PORT/$DATABASE_NAME
|
||||
export DATABASE_URL=postgres://$DATABASE_USER:$PGPASSWORD@$DATABASE_HOST:$DATABASE_PORT/$DATABASE_NAME
|
||||
export DEBUG=True
|
||||
export USE_AWS=False
|
||||
export SERVE_VIA_WEBPACK=False
|
||||
pipenv install --dev --system
|
||||
|
|
|
|||
Loading…
Reference in New Issue