-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from CMSTrackerDPG/develop
Github actions added, tests modified
- Loading branch information
Showing
21 changed files
with
502 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Django CI | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.8] | ||
|
||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
# | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install --upgrade pytest pytest-django pytest-cov codecov mixer selenium | ||
- name: Run Unit Tests | ||
env: | ||
# Main dir is /home/runner/work/certifier | ||
DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }} | ||
DJANGO_DATABASE_ENGINE: django.db.backends.postgresql | ||
DJANGO_DATABASE_NAME: postgres | ||
DJANGO_DATABASE_USER: postgres | ||
DJANGO_DATABASE_PORT: 5432 | ||
DJANGO_DATABASE_PASSWORD: postgres | ||
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} | ||
OMS_CLIENT_ID: ${{ secrets.OMS_CLIENT_ID }} | ||
OMS_CLIENT_SECRET: ${{ secrets.OMS_CLIENT_SECRET }} | ||
|
||
run: | | ||
PYTHONWARNINGS=all pytest --ds=dqmhelper.test_ci_settings --cov=./ --ignore addrefrun/tests/test_addrefrun_views.py --ignore certifier/tests/test_certifier_views.py --ignore oms/tests/test_oms_utils.py | ||
codecov | ||
# - name: Run Functional Tests with Selenium on Chrome | ||
# env: | ||
# DIR_PATH_EOS_CMSML4DC: /home/runner/work/MLplayground/MLplayground/histograms/test_files/ | ||
# DJANGO_DATABASE_ENGINE: ${{ secrets.DJANGO_DATABASE_ENGINE }} | ||
# DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }} | ||
# DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }} | ||
# DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} | ||
# FILE_PATH_EOS_CMSML4DC: ${{ secrets.FILE_PATH_EOS_CMSML4DC }} | ||
# WEB_BROWSER: Chrome | ||
# run: | | ||
# python manage.py test functional_tests | ||
# - name: Run Functional Tests with Selenium on Firefox | ||
# env: | ||
# DIR_PATH_EOS_CMSML4DC: /home/runner/work/MLplayground/MLplayground/histograms/test_files/ | ||
# DJANGO_DATABASE_ENGINE: ${{ secrets.DJANGO_DATABASE_ENGINE }} | ||
# DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }} | ||
# DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }} | ||
# DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} | ||
# FILE_PATH_EOS_CMSML4DC: ${{ secrets.FILE_PATH_EOS_CMSML4DC }} | ||
# WEB_BROWSER: Firefox | ||
# run: | | ||
# python manage.py test functional_tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
from .settings import * | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.postgresql_psycopg2', | ||
'NAME': 'testdb', | ||
'USER': 'travis', | ||
# 'HOST': 'localhost' | ||
"default": { | ||
"ENGINE": "django.db.backends.postgresql", | ||
"NAME": "postgres", | ||
"USER": "postgres", | ||
"HOST": "127.0.0.1", | ||
"PASSWORD": "postgres", | ||
"PORT": 5432, | ||
} | ||
} | ||
|
||
DYNAMIC_PREFERENCES = { | ||
'ENABLE_CACHE': False, | ||
"ENABLE_CACHE": False, | ||
} | ||
|
||
CHANNEL_LAYERS = { | ||
"default": { | ||
"BACKEND": "channels_redis.core.RedisChannelLayer", | ||
"CONFIG": { | ||
"hosts": [("localhost", 6379)], | ||
}, | ||
"CONFIG": {"hosts": [("localhost", 6379)],}, | ||
}, | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.