-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
69 lines (57 loc) · 1.74 KB
/
config.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/python:3.7.0
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}
- run:
name: run tests
environment:
FLASK_APP: hello.py
command: |
. venv/bin/activate
# Background flask app
coverage run \
--parallel-mode \
-m flask run &> /tmp/flask.log &
sleep 1
set -x
cat /tmp/flask.log
# Run a blackbox test -- for simplicity just curl an endpoint
curl http://127.0.0.1:5000/ || true
# Stop the background jump: coverage.py running flask
kill "$(ps -ef | grep flask | grep -v grep | awk '{ print $2 }')"
sleep 1
ls -lah
set +x
# Covert coverage.py into Cobertura.xml report
coverage combine
coverage xml
coverage report
# Upload to codecov
codecov
- store_artifacts:
path: test-reports
destination: test-reports