Skip to content
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

Jadudm/improve dev docs #935

Merged
merged 7 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ backend/data_distro/data_to_load/run_logs/Results_*
backend/data_distro/data_to_load/run_logs/Lines_*
backend/data_distro/data_to_load/run_logs/Errors_*
backend/data_distro/data_to_load/run_logs/Exceptions_*
# And, data people download to load locally
backend/data_distro/data_to_load/*.txt


# Assets
node_modules/
Expand Down
32 changes: 23 additions & 9 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,35 @@ test:
nctest:
@python -m coverage run --source="." manage.py test ${fac.test.scope}

docker-first-run:
docker compose build
docker compose run web python manage.py makemigrations
docker compose run web python manage.py migrate
docker compose run web python manage.py load_test_data
docker compose run web bash -c 'awslocal s3 mb s3://gsa-fac-private-s3'


# Run Django tests with docker
docker-test:
docker-compose build
docker-compose run web python manage.py migrate
docker-compose run web bash -c 'awslocal s3 mb s3://gsa-fac-private-s3'
docker-compose run web python -m coverage run --source="." manage.py test
docker-compose run web python -m coverage report -m --fail-under=90
docker compose build
docker compose run web python manage.py migrate
docker compose run web bash -c 'awslocal s3 mb s3://gsa-fac-private-s3'
docker compose run web python -m coverage run --source="." manage.py test
docker compose run web python -m coverage report -m --fail-under=90

# Run Django tests with docker with no coverage and with scoping
# e.g. just the audit/test_models.py tests:
# make nctest fac.test.scope=audit.test_models"
# or all tests with no coverage:
# make nctest
docker-nctest:
docker-compose build
docker-compose run web python manage.py migrate
docker-compose run web bash -c 'awslocal s3 mb s3://gsa-fac-private-s3'
docker-compose run web python manage.py test ${fac.test.scope}
docker compose build
docker compose run web python manage.py migrate
docker compose run web bash -c 'awslocal s3 mb s3://gsa-fac-private-s3'
docker compose run web python manage.py test ${fac.test.scope}

docker-clean:
docker compose down
docker rm -f $(shell docker ps -a -q)
docker volume rm $(shell docker volume ls -q)
docker compose build
12 changes: 6 additions & 6 deletions backend/requirements/dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
-c ../requirements.txt

awscli-local
bandit
black
coverage
djlint
flake8
localstack
model_bakery
mypy
djlint
types-requests
pandas
pip-tools
whitenoise
toml
pandas
types-python-slugify
localstack
awscli-local
types-requests
whitenoise
38 changes: 19 additions & 19 deletions backend/requirements/requirements.in
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
boto3
cfenv
cryptography
django-cors-headers
django-csp
django-logingov-backend
django-storages
Django>=4.0.8
psycopg2-binary
environs[django]
gunicorn
djangorestframework
pyyaml
uritemplate
django-cors-headers
requests
python-json-logger
djangorestframework-simplejwt
cryptography
cfenv
jsonschema
environs[django]
gunicorn
jsonpath-ng
pycryptodome
pyjwt
jsonschema
oic
django-storages
boto3
django-logingov-backend
django-csp
openpyxl
pandas
psycopg2-binary
pycryptodome
pydash
pyjwt
python-json-logger
python-slugify
openpyxl
pydash
pyyaml
requests
uritemplate
Loading