Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gracedb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
99
Issues
99
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
gracedb
Commits
0ea86150
Commit
0ea86150
authored
Apr 26, 2019
by
Duncan Macleod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: added test jobs using pytest-django
parent
1cc99c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
.gitlab-ci.yml
.gitlab-ci.yml
+72
-0
No files found.
.gitlab-ci.yml
View file @
0ea86150
...
...
@@ -5,14 +5,86 @@ variables:
DOCKER_DRIVER
:
overlay
DOCKER_BRANCH
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_LATEST
:
$CI_REGISTRY_IMAGE:latest
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
stages
:
-
test
-
branch
-
latest
before_script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
.test
:
&test
image
:
ligo/base:stretch
services
:
-
mysql:5.5
variables
:
AWS_SES_ACCESS_KEY_ID
:
"
fake_aws_id"
AWS_SES_SECRET_ACCESS_KEY
:
"
fake_aws_key"
DJANGO_ALERT_EMAIL_FROM
:
"
fake_email"
DJANGO_DB_HOST
:
"
mysql"
DJANGO_DB_PORT
:
"
3306"
DJANGO_DB_NAME
:
"
fake_name"
DJANGO_DB_USER
:
"
root"
DJANGO_DB_PASSWORD
:
"
fake_password"
DJANGO_PRIMARY_FQDN
:
"
fake_fqdn"
DJANGO_SECRET_KEY
:
"
fake_key"
DJANGO_SETTINGS_MODULE
:
"
config.settings.container.dev"
DJANGO_TWILIO_ACCOUNT_SID
:
"
fake_sid"
DJANGO_TWILIO_AUTH_TOKEN
:
"
fake_token"
LVALERT_OVERSEER_PORT
:
"
2"
LVALERT_SERVER
:
"
fake_server"
LVALERT_USER
:
"
fake_user"
LVALERT_PASSWORD
:
"
fake_password"
MYSQL_DB
:
"
${DJANGO_DB_NAME}"
MYSQL_ROOT_PASSWORD
:
"
${DJANGO_DB_PASSWORD}"
before_script
:
# set python version
-
PYTHON_VERSION="${CI_JOB_NAME##*:}"
-
PYTHON_MAJOR="${PYTHON_VERSION:0:1}"
-
if [[ "${PYTHON_MAJOR}" -eq 2 ]]; then PYTHON="python"; else PYTHON="python3"; fi
# install build requirements
-
apt-get -yqq update
-
apt-get install -yqq
git
libmariadbclient-dev
libldap2-dev
libsasl2-dev
libssl-dev
libxml2-dev
swig
${PYTHON}-pip
# install voeventlib for python2
-
if [[ "${PYTHON_MAJOR}" -eq 2 ]]; then apt-get install -yqq python-voeventlib; fi
# install everything else from pip
-
${PYTHON} -m pip install -r requirements.txt
-
${PYTHON} -m pip install pytest-django pytest-cov
# install lalsuite for glue.ligolw
-
${PYTHON} -m pip install lalsuite
# create logs path required for tests
-
mkdir -pv ../logs/
# list packages
-
${PYTHON} -m pip list installed
script
:
-
cd gracedb
-
${PYTHON} -m pytest --cov . --junitxml=${CI_PROJECT_DIR}/junit.xml
after_script
:
-
rm -fvr ${PIP_CACHE_DIR}/log
artifacts
:
reports
:
junit
:
junit.xml
cache
:
paths
:
-
.cache/pip
test:2.7:
<<
:
*test
test:3.7:
<<
:
*test
allow_failure
:
true
branch_image
:
stage
:
branch
script
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment