Skip to content

Commit

Permalink
infra: accelerate builds (open-telemetry#693)
Browse files Browse the repository at this point in the history
Some build time improvements:

- split lint/docker-tests/docs into their own steps. Since lint is usually the thing that fails anyways, it's good to have it run first. We could make the build depend on this step to prevent slowing other builds waiting in the pipeline (since we only have 5 workers)
- move all pip install commands into a single line per test environment. this reduces the overhead of calling the pip command separately multiple times per environment.
- removed pip upgrade command for pypy3 and py38
  • Loading branch information
alrex authored May 21, 2020
1 parent 2249748 commit ae533f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 48 deletions.
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ language: python

cache: pip

python:
- 'pypy3'
- '3.8'
- '3.4'
- '3.5'
- '3.6'
- '3.7'
matrix:
include:
- python: 3.8
env: TOXENV=lint
- python: pypy3
- python: 3.8
- python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8
env: TOXENV=docker-tests
- python: 3.8
env: TOXENV=docs

#matrix:
# allow_failures:
Expand Down
55 changes: 14 additions & 41 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ envlist =
docs
docker-tests

[travis]
python =
3.8: py38, lint, docs, docker-tests

[testenv]
deps =
-c dev-requirements.txt
Expand Down Expand Up @@ -159,26 +155,16 @@ changedir =

commands_pre =
; Install without -e to test the actual installation
python -m pip install -U pip setuptools wheel

py3{4,5,6,7}: python -m pip install -U pip setuptools wheel
; Install common packages for all the tests. These are not needed in all the
; cases but it saves a lot of boilerplate in this file.
test: pip install {toxinidir}/opentelemetry-api
test: pip install {toxinidir}/opentelemetry-sdk
test: pip install {toxinidir}/tests/util
test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util

test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation

example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation
example-app: pip install {toxinidir}/ext/opentelemetry-ext-requests
example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask
example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app
example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app

getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation
getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-requests
getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi
getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-flask
getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask

grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test]

Expand All @@ -191,48 +177,35 @@ commands_pre =

django: pip install {toxinidir}/ext/opentelemetry-ext-django[test]

mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation
mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql[test]
mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test]

otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector

prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus

pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation
pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test]
pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-pymongo[test]

psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation
psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2[test]
psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test]

pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation
pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql[test]
pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test]

redis: pip install {toxinidir}/opentelemetry-auto-instrumentation
redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test]
redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test]

requests: pip install {toxinidir}/opentelemetry-auto-instrumentation
requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test]
requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test]

jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation
jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test]
jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-jinja2[test]

aiohttp-client: pip install {toxinidir}/opentelemetry-sdk
aiohttp-client: pip install {toxinidir}/ext/opentelemetry-ext-aiohttp-client
aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client

jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger

datadog: pip install {toxinidir}/opentelemetry-sdk
datadog: pip install {toxinidir}/ext/opentelemetry-ext-datadog
datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog

opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim

zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin

sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation
sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy
sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy

; In order to get a healthy coverage report,
; we have to install packages in editable mode.
Expand Down

0 comments on commit ae533f7

Please sign in to comment.