-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.gitlab-ci.yml
31 lines (29 loc) · 998 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
stages:
- "run_pytest"
run_pytest:
tags:
- docker
- cloud_governance
image: python:3.9
stage: run_pytest
before_script:
- apt-get update && apt-get install -y build-essential python3-dev libldap2-dev libsasl2-dev
- python -m pip install --upgrade pip
- pip install flake8 pytest pytest-cov
- if [[ -f requirements.txt ]]; then pip install -r requirements.txt; fi
- if [[ -f tests_requirements.txt ]]; then pip install -r tests_requirements.txt; fi
script:
- pip install pytest
- pytest -v tests/unittest/
environment: testing
set_kubeconfig_and_hosts:
stage: setup
script:
- mkdir -p "$RUNNER_PATH/.kube/"
- echo "$KUBECONFIG_CONTENTS" > "$RUNNER_PATH/.kube/config"
- echo "KUBECONFIG_PATH=$RUNNER_PATH/.kube/config" >> "$CI_ENVIRONMENT_URL/.env"
- echo "$OCP_HOSTS" | sudo tee -a /etc/hosts > /dev/null
variables:
KUBECONFIG_CONTENTS: "$PERF_KUBECONFIG"
RUNNER_PATH: "$RUNNER_PATH"
OCP_HOSTS: "$PERF_OCP_HOSTS"