Skip to content

Commit

Permalink
added more source_id settings
Browse files Browse the repository at this point in the history
adjusted metadata
expose source ids
env var
env var
azure-pipelines

pipeline

denise

db?

postgres
  • Loading branch information
domdinicola committed Oct 27, 2020
1 parent 1700bd2 commit e1b449e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 27 deletions.
71 changes: 71 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
trigger:
- feature/azure-pipelines

pool:
vmImage: 'Ubuntu-18.04'

variables:
# imageName: 'unicef/donor-reporting-portal-backend'
imageName: 'scs-drp-be'
dockerHub: 'uniwebsscsdrpdev'
DATABASE_URL: 'psql://postgres:pass@postgres:5432/donor_reporting_portal'
HOST: 'http://localhost:8082'
SECRET_KEY: 'top-secret'
INSIGHT_URL: 'https://uniapis.unicef.org/biapi/v1/'
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DB: donor_reporting_portal

container:
image: postgres:12-alpine
# options: --hostname container-test --ip 192.168.0.1
ports:
- 8080:80
- 5432

strategy:
matrix:
Python38:
python.version: '3.8'

steps:
- task: UsePythonVersion@0

- script: |
env
apt install -y postgresql-client
psql --host=postgres --username=postgres --command="SELECT 1;"
python --version
python -m pip install --upgrade pip
pip install tox pipenv
displayName: 'Install dependencies'

- script: |
tox --version
tox
displayName: 'Run tests'

#- task: PublishTestResults@2
# inputs:
# testResultsFiles: 'tests/report.xml'
# testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
# condition: succeededOrFailed()

#- task: Docker@2
# displayName: Build an image
# inputs:
# repository: $(imageName)
# command: build
# Dockerfile: docker/Dockerfile
# buildContext: .

#- task: Docker@2
# displayName: Push image
# inputs:
# containerRegistry: |
# $(dockerHub)
# repository: $(imageName)
# command: push
# tags: |
# $(Build.BuildId)
# latest
23 changes: 23 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[pytest]
norecursedirs = data .tox
python_paths = ./tests/_test_lib ./src/
DJANGO_SETTINGS_MODULE = donor_reporting_portal.config.settings
django_find_project = false
addopts =
-v
--reuse-db
--tb=short
--maxfail=20
--echo-version=donor_reporting_portal
--echo-version=django
--echo-env=CIRCLECI
--echo-env=PIPENV_VERBOSITY
--capture=no
--cov-report=html
--cov-config=tests/.coveragerc
--cov=donor_reporting_portal

markers =
slow: marks tests as slow (deselect with '-m "not slow"')

pep8ignore = * ALL
2 changes: 1 addition & 1 deletion src/donor_reporting_portal/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

SECRET_KEY = env('SECRET_KEY')
SECRET_KEY = env('SECRET_KEY', default='change-me')
ALLOWED_HOSTS = (
env('ALLOWED_HOST', default='localhost'),
'0.0.0.0',
Expand Down
29 changes: 3 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
[pytest]
norecursedirs = data .tox
python_paths = ./tests/_test_lib ./src/
DJANGO_SETTINGS_MODULE = donor_reporting_portal.config.settings
django_find_project = false
addopts =
-v
--reuse-db
--tb=short
--maxfail=20
--echo-version=donor_reporting_portal
--echo-version=django
--echo-env=CIRCLECI
--echo-env=PIPENV_VERBOSITY
--capture=no
--cov-report=html
--cov-config=tests/.coveragerc
--cov=donor_reporting_portal

markers =
slow: marks tests as slow (deselect with '-m "not slow"')

pep8ignore = * ALL

[tox]
envlist = d{30,31}
envlist = d{31}
envtmpdir={toxinidir}/build/{envname}/tmp
envlogdir={toxinidir}/build/{envname}/log

Expand Down Expand Up @@ -64,7 +40,8 @@ commands =
--cov-report=html \
--cov-report=term \
--cov-config={toxinidir}/tests/.coveragerc \
--cov=donor_reporting_portal
--cov=donor_reporting_portal \
--junitxml={toxinidir}/tests/report.xml

[testenv:report]
commands =
Expand Down

0 comments on commit e1b449e

Please sign in to comment.