Skip to content

Commit b5a6930

Browse files
authored
Merge pull request #75 from isaaczinda/master
Add performance regression tests and performance reports to CI
2 parents ce7639e + b6fece8 commit b5a6930

File tree

2 files changed

+186
-55
lines changed

2 files changed

+186
-55
lines changed

.circleci/config.yml

+159-55
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ jobs:
77
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
88
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
99
docker:
10-
- image: circleci/python:2.7
10+
- image: circleci/python:2.7
1111
steps:
12-
- checkout
13-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
14-
- run: sudo pip install tox
15-
- run: make test27
16-
- store_test_results:
17-
path: /tmp/circleci-test-results
18-
- store_artifacts:
19-
path: /tmp/circleci-artifacts
20-
- store_artifacts:
21-
path: /tmp/circleci-test-results
12+
- checkout
13+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
14+
- run: sudo pip install tox
15+
- run: make test27
16+
- store_test_results:
17+
path: /tmp/circleci-test-results
18+
- store_artifacts:
19+
path: /tmp/circleci-artifacts
20+
- store_artifacts:
21+
path: /tmp/circleci-test-results
2222

2323
test-python3.4:
2424
working_directory: ~/lightstep/lightstep-tracer-python
@@ -27,18 +27,18 @@ jobs:
2727
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
2828
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
2929
docker:
30-
- image: circleci/python:3.4
30+
- image: circleci/python:3.4
3131
steps:
32-
- checkout
33-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
34-
- run: sudo pip install tox
35-
- run: make test34
36-
- store_test_results:
37-
path: /tmp/circleci-test-results
38-
- store_artifacts:
39-
path: /tmp/circleci-artifacts
40-
- store_artifacts:
41-
path: /tmp/circleci-test-results
32+
- checkout
33+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
34+
- run: sudo pip install tox
35+
- run: make test34
36+
- store_test_results:
37+
path: /tmp/circleci-test-results
38+
- store_artifacts:
39+
path: /tmp/circleci-artifacts
40+
- store_artifacts:
41+
path: /tmp/circleci-test-results
4242

4343
test-python3.5:
4444
working_directory: ~/lightstep/lightstep-tracer-python
@@ -47,18 +47,18 @@ jobs:
4747
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
4848
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
4949
docker:
50-
- image: circleci/python:3.5
50+
- image: circleci/python:3.5
5151
steps:
52-
- checkout
53-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
54-
- run: sudo pip install tox
55-
- run: make test35
56-
- store_test_results:
57-
path: /tmp/circleci-test-results
58-
- store_artifacts:
59-
path: /tmp/circleci-artifacts
60-
- store_artifacts:
61-
path: /tmp/circleci-test-results
52+
- checkout
53+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
54+
- run: sudo pip install tox
55+
- run: make test35
56+
- store_test_results:
57+
path: /tmp/circleci-test-results
58+
- store_artifacts:
59+
path: /tmp/circleci-artifacts
60+
- store_artifacts:
61+
path: /tmp/circleci-test-results
6262

6363
test-python3.6:
6464
working_directory: ~/lightstep/lightstep-tracer-python
@@ -67,18 +67,18 @@ jobs:
6767
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
6868
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
6969
docker:
70-
- image: circleci/python:3.6
70+
- image: circleci/python:3.6
7171
steps:
72-
- checkout
73-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
74-
- run: sudo pip install tox
75-
- run: make test36
76-
- store_test_results:
77-
path: /tmp/circleci-test-results
78-
- store_artifacts:
79-
path: /tmp/circleci-artifacts
80-
- store_artifacts:
81-
path: /tmp/circleci-test-results
72+
- checkout
73+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
74+
- run: sudo pip install tox
75+
- run: make test36
76+
- store_test_results:
77+
path: /tmp/circleci-test-results
78+
- store_artifacts:
79+
path: /tmp/circleci-artifacts
80+
- store_artifacts:
81+
path: /tmp/circleci-test-results
8282

8383
test-python3.7:
8484
working_directory: ~/lightstep/lightstep-tracer-python
@@ -87,18 +87,107 @@ jobs:
8787
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
8888
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
8989
docker:
90-
- image: circleci/python:3.7
90+
- image: circleci/python:3.7
9191
steps:
92-
- checkout
93-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
94-
- run: sudo pip install tox
95-
- run: make test37
96-
- store_test_results:
97-
path: /tmp/circleci-test-results
98-
- store_artifacts:
99-
path: /tmp/circleci-artifacts
100-
- store_artifacts:
101-
path: /tmp/circleci-test-results
92+
- checkout
93+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
94+
- run: sudo pip install tox
95+
- run: make test37
96+
- store_test_results:
97+
path: /tmp/circleci-test-results
98+
- store_artifacts:
99+
path: /tmp/circleci-artifacts
100+
- store_artifacts:
101+
path: /tmp/circleci-test-results
102+
103+
regression_test:
104+
resource_class: xlarge
105+
docker:
106+
- image: circleci/python:3.7.4
107+
working_directory: ~/repo
108+
steps:
109+
- checkout
110+
- run: cd ~; ~/repo/ci/clone_lightstep_benchmarks.sh
111+
- run: ~/lightstep-benchmarks/scripts/ci_setup.sh
112+
- run: sudo pip install -e ~/repo
113+
- run: |
114+
cd ~/lightstep-benchmarks/
115+
pytest -s --client_name python regression_tests.py
116+
- store_artifacts:
117+
path: ~/lightstep-benchmarks/logs
118+
destination: logs
119+
120+
make_cpu_graphs:
121+
resource_class: xlarge
122+
docker:
123+
- image: circleci/python:3.7.4
124+
working_directory: ~/repo
125+
steps:
126+
- checkout
127+
- run: cd ~; ~/repo/ci/clone_lightstep_benchmarks.sh
128+
- run: ~/lightstep-benchmarks/scripts/ci_setup.sh
129+
- run: sudo pip install -e ~/repo
130+
- run: python ~/lightstep-benchmarks/cpu_graphs.py python --runtime 10 --trials 20
131+
- store_artifacts:
132+
path: ~/lightstep-benchmarks/graphs
133+
destination: graphs
134+
- store_artifacts:
135+
path: ~/lightstep-benchmarks/logs
136+
destination: logs
137+
138+
make_dropped_graphs:
139+
resource_class: xlarge
140+
docker:
141+
- image: circleci/python:3.7.4
142+
working_directory: ~/repo
143+
steps:
144+
- checkout
145+
- run: cd ~; ~/repo/ci/clone_lightstep_benchmarks.sh
146+
- run: ~/lightstep-benchmarks/scripts/ci_setup.sh
147+
- run: sudo pip install -e ~/repo
148+
- run: python ~/lightstep-benchmarks/dropped_graphs.py python
149+
- store_artifacts:
150+
path: ~/lightstep-benchmarks/graphs
151+
destination: graphs
152+
- store_artifacts:
153+
path: ~/lightstep-benchmarks/logs
154+
destination: logs
155+
156+
make_memory_graphs:
157+
resource_class: xlarge
158+
docker:
159+
- image: circleci/python:3.7.4
160+
working_directory: ~/repo
161+
steps:
162+
- checkout
163+
- run: cd ~; ~/repo/ci/clone_lightstep_benchmarks.sh
164+
- run: ~/lightstep-benchmarks/scripts/ci_setup.sh
165+
- run: sudo pip install -e ~/repo
166+
- run: python ~/lightstep-benchmarks/memory_graphs.py python
167+
- store_artifacts:
168+
path: ~/lightstep-benchmarks/graphs
169+
destination: graphs
170+
- store_artifacts:
171+
path: ~/lightstep-benchmarks/logs
172+
destination: logs
173+
174+
make_disconnect_graphs:
175+
resource_class: xlarge
176+
docker:
177+
- image: circleci/python:3.7.4
178+
working_directory: ~/repo
179+
steps:
180+
- checkout
181+
- run: cd ~; ~/repo/ci/clone_lightstep_benchmarks.sh
182+
- run: ~/lightstep-benchmarks/scripts/ci_setup.sh
183+
- run: sudo pip install -e ~/repo
184+
- run: python ~/lightstep-benchmarks/disconnect_graphs.py python
185+
- store_artifacts:
186+
path: ~/lightstep-benchmarks/graphs
187+
destination: graphs
188+
- store_artifacts:
189+
path: ~/lightstep-benchmarks/logs
190+
destination: logs
102191

103192
workflows:
104193
version: 2
@@ -109,3 +198,18 @@ workflows:
109198
- test-python3.5
110199
- test-python3.6
111200
- test-python3.7
201+
- regression_test
202+
- approve_make_graphs:
203+
type: approval
204+
- make_dropped_graphs:
205+
requires:
206+
- approve_make_graphs
207+
- make_memory_graphs:
208+
requires:
209+
- approve_make_graphs
210+
- make_disconnect_graphs:
211+
requires:
212+
- approve_make_graphs
213+
- make_cpu_graphs:
214+
requires:
215+
- approve_make_graphs

ci/clone_lightstep_benchmarks.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
REPO_URL="https://github.com/lightstep/lightstep-benchmarks.git"
6+
MAJOR_VERSION="0"
7+
8+
# clone the repo
9+
git clone ${REPO_URL}
10+
cd lightstep-benchmarks
11+
12+
# copy the tags to the local repo (from all remotes)
13+
git fetch --all --tags
14+
15+
# find most recent release whose tag matches the specified major / minor
16+
# version
17+
MATCHING_VERSIONS=`git tag --sort -version:refname --list "v${MAJOR_VERSION}.*.*" | tr '\n' ','`
18+
NEWEST_VERSION=`echo ${MATCHING_VERSIONS} | cut -d ',' -f 1`
19+
20+
echo "versions, newest to oldest: ${MATCHING_VERSIONS}"
21+
echo "newest version: ${NEWEST_VERSION}"
22+
23+
# checkout the code corresponding to the newest tag
24+
git checkout tags/${NEWEST_VERSION}
25+
26+
# so that we can confirm everything is a-okay
27+
git branch; git tag

0 commit comments

Comments
 (0)