Commit be2b2da4 authored by Nicolas Schmid's avatar Nicolas Schmid
Browse files

tests: squashed, add testing pipeline

parent 112dc71c
Pipeline #2203 passed with stages
in 2 minutes and 37 seconds
stages:
- codestyle
- test
.test-rules:
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
when: always
- if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "main"'
when: always
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != "develop"'
when: always
.add-ssh:
&add-ssh ## Install ssh-agent if not already installed, it is required by Docker.
- "command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )"
## Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
## Create the SSH directory and give it the right permissions
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -t rsa gitlab.seismo.ethz.ch >> ~/.ssh/known_hosts
- apt-get update
- apt-get install -y python3-dev build-essential
.add-env: &add-env
- echo POSTGRES_DB=$POSTGRES_DB >> .env
- echo POSTGRES_PASSWORD=$POSTGRES_PASSWORD >> .env
- echo POSTGRES_PORT=$POSTGRES_PORT >> .env
- echo POSTGRES_SERVER=$POSTGRES_SERVER >> .env
- echo POSTGRES_USER=$POSTGRES_USER >> .env
flake8-job:
stage: codestyle
extends: .test-rules
image: python:3.8-alpine
before_script:
- pip install tox
script:
- tox -e flake8
py38-test-job:
stage: test
extends: .test-rules
needs: ["flake8-job"]
image: python:3.8
before_script:
- *add-ssh
- *add-env
- pip install tox
script:
- tox -e py38-tests
artifacts:
reports:
cobertura: coverage.xml
# ramsis-ws
Web service for access to data defined by ramsis.datamodel
\ No newline at end of file
[![pipeline status](https://gitlab.seismo.ethz.ch/indu/ramsis-ws/badges/develop/pipeline.svg)](https://gitlab.seismo.ethz.ch/indu/ramsis-ws/-/commits/develop)
[![coverage report](https://gitlab.seismo.ethz.ch/indu/ramsis-ws/badges/develop/coverage.svg)](https://gitlab.seismo.ethz.ch/indu/ramsis-ws/-/commits/develop)
Web service for access to data defined by ramsis.datamodel
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment