1
1
version : 2.1
2
2
3
3
commands :
4
- influxdb-restart :
4
+ influxdb-onboarding :
5
5
steps :
6
6
- run :
7
- name : " Start InfluxDB service "
8
- command : ./scripts/influxdb-restart .sh
7
+ name : " Post onBoarding request to InfluxDB 2 "
8
+ command : ./scripts/influxdb-onboarding .sh
9
9
prepare :
10
10
description : " Prepare environment to tests"
11
11
steps :
12
12
- checkout
13
- - influxdb-restart
13
+ - influxdb-onboarding
14
14
client-test :
15
15
description : " Run tests"
16
16
parameters :
17
- python-version :
17
+ python-image :
18
18
type : string
19
- default : &default-python-version "3"
20
19
steps :
21
20
- restore_cache :
22
21
name : Restoring Pip Cache
23
22
keys :
24
- - &cache-key pip-cache-v2-<< parameters.python-version >>-{{ checksum "requirements.txt" }}-{{ checksum "test-requirements.txt" }}
25
- - pip-cache-v2-<< parameters.python-version >>-
23
+ - &cache-key pip-cache-v7-<< parameters.python-image >>-{{ checksum "requirements.txt" }}-{{ checksum "test-requirements.txt" }}-{{ checksum "extra-requirements.txt" }}
24
+ - pip-cache-v7-<< parameters.python-image >>-
25
+ - run :
26
+ command : | # use pipenv to install dependencies
27
+ sudo pip install pipenv
28
+ pipenv install
26
29
- run :
27
30
name : " Running tests"
28
- command : |
29
- docker run -it --rm \
30
- --volume ${PWD}:/usr/src/project \
31
- --volume ${PWD}/.cache:/root/.cache/pip/ \
32
- --workdir /usr/src/project \
33
- --network influx_network \
34
- --env INFLUXDB_V2_URL="http://192.168.0.2:9999" \
35
- python:<< parameters.python-version >> /bin/bash -c "./scripts/ci-test.sh"
31
+ command : ./scripts/ci-test.sh
36
32
- save_cache :
37
33
name : Saving Pip Cache
38
34
key : *cache-key
39
35
paths :
40
- - ./cache
36
+ - " .venv"
37
+ - " ~/.cache/pip"
38
+ # - "/usr/local/lib/python3.8/site-packages"
39
+ # - "/usr/local/lib/python3.7/site-packages"
40
+ # - "/usr/local/lib/python3.6/site-packages"
41
+ - " /usr/local/lib/site-python"
41
42
when : always
42
43
jobs :
43
- tests-python-3 :
44
- machine : true
44
+ tests-python :
45
45
parameters :
46
- influxdb-repository :
46
+ python-image :
47
47
type : string
48
- default : " influxdb "
49
- influxdb-version :
48
+ default : " circleci/python:3.6-buster "
49
+ influxdb-image :
50
50
type : string
51
- default : " 2.0.0-beta"
52
- environment :
53
- INFLUXDB_V2_REPOSITORY : << parameters.influxdb-repository >>
54
- INFLUXDB_V2_VERSION : << parameters.influxdb-version >>
51
+ default : " influxdb:2.0.0-beta"
52
+ docker :
53
+ - image : << parameters.python-image >>
54
+ environment : # environment variables for primary container
55
+ PIPENV_VENV_IN_PROJECT : true
56
+ - image : quay.io/influxdb/<< parameters.influxdb-image >>
55
57
steps :
56
58
- prepare
57
59
- client-test :
58
- python-version : *default- python-version
60
+ python-image : << parameters. python-image >>
59
61
- store_test_results :
60
62
path : test-reports
61
63
- run :
@@ -66,12 +68,17 @@ workflows:
66
68
version : 2
67
69
build :
68
70
jobs :
69
- - tests-python-3 :
70
- name : test-beta
71
- - tests-python-3 :
72
- name : test-nightly
73
- influxdb-repository : " influx"
74
- influxdb-version : " nightly"
71
+ - tests-python :
72
+ name : python-3.6
73
+ - tests-python :
74
+ name : python-3.6-nightly
75
+ influxdb-image : " influx:nightly"
76
+ - tests-python :
77
+ name : python-3.7
78
+ python-image : " circleci/python:3.7-buster"
79
+ - tests-python :
80
+ name : python-3.8
81
+ python-image : " circleci/python:3.8-buster"
75
82
76
83
nightly :
77
84
triggers :
@@ -82,4 +89,4 @@ workflows:
82
89
only :
83
90
- master
84
91
jobs :
85
- - tests-python-3
92
+ - tests-python
0 commit comments