Skip to content

Commit

Permalink
WIP GH
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed May 27, 2024
1 parent d9ff556 commit a8a1c40
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
SERVICE_ACCOUNT_BACKEND_URL: redis://localhost:6379/4
CACHE_URL: redis://localhost:6379/3
ENKETO_REDIS_MAIN_URL: redis://localhost:6379/0
KOBOCAT_MEDIA_ROOT: /tmp/media
strategy:
matrix:
python-version: ['3.8', '3.10']
python-version: ['3.10']
services:
postgres:
image: postgis/postgis:14-3.4
Expand Down Expand Up @@ -59,8 +60,9 @@ jobs:
- name: Test back-end code
# Explicitly name the directories where coverage should be measured;
# specifying just `--cov=.` includes `src`, which contains third-party packages
run: pytest --cov=hub --cov=kobo --cov=kpi -ra
- name: Run coveralls for back-end code
uses: AndreMiras/coveralls-python-action@develop
# Coveralls action will intermittently give 422 errors - until that issue is resolved this step allowed to error.
continue-on-error: true
run: pytest -vv --disable-warnings kobo/apps/openrosa/apps/viewer/tests/test_exports.py::TestExports::test_create_export
# run: pytest --cov=hub --cov=kobo --cov=kpi -ra
# - name: Run coveralls for back-end code
# uses: AndreMiras/coveralls-python-action@develop
# # Coveralls action will intermittently give 422 errors - until that issue is resolved this step allowed to error.
# continue-on-error: true
5 changes: 2 additions & 3 deletions kobo/apps/openrosa/apps/logger/models/xform.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@

def upload_to(instance, filename):
return os.path.join(
instance.user.username,
'xls',
os.path.split(filename)[1])
instance.user.username, 'xls', os.path.split(filename)[1]
)


class XFormWithoutPendingDeletedManager(models.Manager):
Expand Down
2 changes: 1 addition & 1 deletion kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ def dj_stripe_request_callback_method():
}
else:
KOBOCAT_DEFAULT_FILE_STORAGE = global_settings.STORAGES['default']['BACKEND']
KOBOCAT_MEDIA_PATH = os.environ.get('KOBOCAT_MEDIA_PATH', '/srv/src/kobocat/media')
KOBOCAT_MEDIA_ROOT = os.environ.get('KOBOCAT_MEDIA_ROOT', MEDIA_ROOT)

# Google Cloud Storage
# Not fully supported as a generic storage backend
Expand Down
1 change: 0 additions & 1 deletion kobo/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# Run all Celery tasks synchronously during testing
CELERY_TASK_ALWAYS_EAGER = True


MONGO_CONNECTION_URL = 'mongodb://fakehost/formhub_test'
mongo_client = MockMongoClient(
MONGO_CONNECTION_URL, connect=False, journal=True, tz_aware=True
Expand Down
2 changes: 1 addition & 1 deletion kpi/deployment_backends/kc_access/shadow_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def protected_path(self, format_: Optional[str] = None):
# (out of ASCII character set) and must be encoded to let NGINX serve
# them
protected_url = urlquote(attachment_file_path.replace(
settings.KOBOCAT_MEDIA_PATH, '/protected')
settings.KOBOCAT_MEDIA_ROOT, '/protected')
)
else:
# Double-encode the S3 URL to take advantage of NGINX's
Expand Down
2 changes: 1 addition & 1 deletion kpi/deployment_backends/kc_access/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
directory_permissions_mode=None,
):
location = (
django_settings.KOBOCAT_MEDIA_PATH if not location else location
django_settings.KOBOCAT_MEDIA_ROOT if not location else location
)
super().__init__(
location=location,
Expand Down

0 comments on commit a8a1c40

Please sign in to comment.