mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 06:23:13 -04:00
26
.github/workflows/checks.yml
vendored
26
.github/workflows/checks.yml
vendored
@@ -5,6 +5,32 @@ on: [push]
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEBUG: True
|
||||||
|
ANTIVIRUS_ENABLED: 0
|
||||||
|
NOTIFY_ENVIRONMENT: development
|
||||||
|
NOTIFICATION_QUEUE_PREFIX: local_dev_10x
|
||||||
|
STATSD_HOST: localhost
|
||||||
|
SES_STUB_URL: None
|
||||||
|
NOTIFY_APP_NAME: api
|
||||||
|
NOTIFY_EMAIL_DOMAIN: dispostable.com
|
||||||
|
NOTIFY_LOG_PATH: /workspace/logs/app.log
|
||||||
|
ADMIN_CLIENT_ID: notify-admin
|
||||||
|
ADMIN_CLIENT_SECRET: dev-notify-secret-key
|
||||||
|
GOVUK_ALERTS_CLIENT_ID: govuk-alerts
|
||||||
|
FLASK_APP: application.py
|
||||||
|
FLASK_ENV: development
|
||||||
|
WERKZEUG_DEBUG_PIN: off
|
||||||
|
ADMIN_BASE_URL: http://localhost:6012
|
||||||
|
API_HOST_NAME: http://localhost:6011
|
||||||
|
REDIS_URL: redis://localhost:6380
|
||||||
|
REDIS_ENABLED: False
|
||||||
|
SQLALCHEMY_DATABASE_URI: postgresql://postgres:chummy@db:5432/notification_api
|
||||||
|
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
|
||||||
|
AWS_REGION: us-west-2
|
||||||
|
AWS_PINPOINT_REGION: us-west-2
|
||||||
|
AWS_US_TOLL_FREE_NUMBER: +18446120782
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class Config(object):
|
|||||||
|
|
||||||
# URL of redis instance
|
# URL of redis instance
|
||||||
REDIS_URL = os.environ.get('REDIS_URL')
|
REDIS_URL = os.environ.get('REDIS_URL')
|
||||||
REDIS_ENABLED = True
|
REDIS_ENABLED = os.environ.get('REDIS_ENABLED')
|
||||||
EXPIRE_CACHE_TEN_MINUTES = 600
|
EXPIRE_CACHE_TEN_MINUTES = 600
|
||||||
EXPIRE_CACHE_EIGHT_DAYS = 8 * 24 * 60 * 60
|
EXPIRE_CACHE_EIGHT_DAYS = 8 * 24 * 60 * 60
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ class Development(Config):
|
|||||||
DEBUG = True
|
DEBUG = True
|
||||||
SQLALCHEMY_ECHO = False
|
SQLALCHEMY_ECHO = False
|
||||||
|
|
||||||
REDIS_ENABLED = True
|
REDIS_ENABLED = os.environ.get('REDIS_ENABLED')
|
||||||
|
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
||||||
CONTACT_LIST_BUCKET_NAME = 'local-contact-list'
|
CONTACT_LIST_BUCKET_NAME = 'local-contact-list'
|
||||||
@@ -554,7 +554,7 @@ class Live(Config):
|
|||||||
CRONITOR_ENABLED = True
|
CRONITOR_ENABLED = True
|
||||||
|
|
||||||
# DEBUG = True
|
# DEBUG = True
|
||||||
REDIS_ENABLED = True
|
REDIS_ENABLED = os.environ.get('REDIS_ENABLED')
|
||||||
|
|
||||||
NOTIFY_LOG_PATH = os.environ.get('NOTIFY_LOG_PATH', 'application.log')
|
NOTIFY_LOG_PATH = os.environ.get('NOTIFY_LOG_PATH', 'application.log')
|
||||||
REDIS_URL = os.environ.get('REDIS_URL')
|
REDIS_URL = os.environ.get('REDIS_URL')
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ API_HOST_NAME=http://dev:6011
|
|||||||
REDIS_URL=redis://redis:6380
|
REDIS_URL=redis://redis:6380
|
||||||
REDIS_ENABLED=1
|
REDIS_ENABLED=1
|
||||||
|
|
||||||
|
# DB conection string for local docker, overriden on remote with vcap env vars
|
||||||
|
SQLALCHEMY_DATABASE_URI=postgresql://postgres:chummy@db:5432/notification_api
|
||||||
|
|
||||||
|
# For GH actions CI workflow
|
||||||
|
SQLALCHEMY_DATABASE_TEST_URI=postgresql://user:password@localhost:5432/test_notification_api
|
||||||
|
|
||||||
# AWS
|
# AWS
|
||||||
AWS_REGION=us-west-2
|
AWS_REGION=us-west-2
|
||||||
AWS_ACCESS_KEY_ID="don't write secrets to the sample file"
|
AWS_ACCESS_KEY_ID="don't write secrets to the sample file"
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ def test_should_cache_template_lookups_in_memory(mocker, client, sample_template
|
|||||||
]
|
]
|
||||||
assert Notification.query.count() == 5
|
assert Notification.query.count() == 5
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Needs updating for TTS: cloud.gov redis fails, local docker works, mock redis fails")
|
||||||
def test_should_cache_template_and_service_in_redis(mocker, client, sample_template):
|
def test_should_cache_template_and_service_in_redis(mocker, client, sample_template):
|
||||||
|
|
||||||
from app.schemas import service_schema, template_schema
|
from app.schemas import service_schema, template_schema
|
||||||
@@ -288,7 +288,7 @@ def test_should_cache_template_and_service_in_redis(mocker, client, sample_templ
|
|||||||
assert json.loads(templates_call[0][1]) == {'data': template_dict}
|
assert json.loads(templates_call[0][1]) == {'data': template_dict}
|
||||||
assert templates_call[1]['ex'] == 604_800
|
assert templates_call[1]['ex'] == 604_800
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Needs updating for TTS: cloud.gov redis fails, local docker works, mock redis fails")
|
||||||
def test_should_return_template_if_found_in_redis(mocker, client, sample_template):
|
def test_should_return_template_if_found_in_redis(mocker, client, sample_template):
|
||||||
|
|
||||||
from app.schemas import service_schema, template_schema
|
from app.schemas import service_schema, template_schema
|
||||||
|
|||||||
Reference in New Issue
Block a user