Skip to content

ci: introduce riot, use it to run tracer tests #1737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ commands:
paths:
- ".tox"

run_test:
description: "Run tests matching a pattern"
parameters:
pattern:
type: string
default: ""
wait:
type: string
default: ""
steps:
- attach_workspace:
at: .
- run: pip3 install riot
- when:
condition:
<< parameters.wait >>
steps:
- run:
name: "Waiting for << parameters.wait >>"
command: pip install tox && tox -e 'wait' << parameters.wait >>
- run:
name: "Running tests matching '<< parameters.pattern >>'"
command: "riot -v run -s '<< parameters.pattern >>'"

run_tox_scenario:
description: "Run scripts/run-tox-scenario with setup, caching and persistence"
parameters:
Expand Down Expand Up @@ -231,6 +255,19 @@ jobs:
- setup_tox
- run: tox -e flake8

build_base:
executor: ddtrace_dev
steps:
- checkout
- run: pip3 install riot
- run:
name: "Generate base virtual environments."
command: "riot -v generate"
- persist_to_workspace:
root: .
paths:
- "."

build-docker-ci-image:
executor: cimg_base
steps:
Expand Down Expand Up @@ -292,8 +329,8 @@ jobs:
tracer:
executor: ddtrace_dev
steps:
- run_tox_scenario:
pattern: '^py..-tracer'
- run_test:
pattern: "tracer"

opentracer:
executor: ddtrace_dev
Expand Down Expand Up @@ -803,6 +840,7 @@ requires_pre_test: &requires_pre_test
- black
- flake8
- ccheck
- build_base

requires_tests: &requires_tests
- build_docs
Expand Down Expand Up @@ -893,6 +931,7 @@ workflows:
- black
- flake8
- ccheck
- build_base

# Test building the package
- test_build_alpine: *requires_pre_test
Expand Down Expand Up @@ -963,7 +1002,6 @@ workflows:
- sqlite3: *requires_pre_test
- test_logging: *requires_pre_test
- tornado: *requires_pre_test
# tracer
- tracer: *requires_pre_test
- vertica: *requires_pre_test
- build-docker-ci-image: *requires_pre_test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ RUN \
&& pyenv global 3.8.6 2.7.17 3.5.10 3.6.12 3.7.9 3.9.0 \
&& pip install --upgrade pip

RUN pip install tox
RUN pip install tox riot

CMD ["/bin/bash"]
28 changes: 28 additions & 0 deletions riotfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from riot import Suite, Case

global_deps = [
"mock",
"pytest<4",
"pytest-benchmark",
]

global_env = [("PYTEST_ADDOPTS", "--color=yes")]

suites = [
Suite(
name="tracer",
command="pytest tests/tracer/",
cases=[
Case(
pys=[
2.7,
3.5,
3.6,
3.7,
3.8,
],
pkgs=[("msgpack", [""])],
),
],
),
]
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ envlist =
flake8
black
wait
{py27,py35,py36,py37,py38}-tracer
{py27,py35,py36,py37,py38,py39}-profile{,-gevent}
{py27,py35,py36,py37,py38,py39}-profile-minreqs{,-gevent}
{py27,py35,py36,py37,py38}-integration
Expand Down Expand Up @@ -188,7 +187,6 @@ deps =
# test dependencies installed in all envs
mock
# used to test our custom msgpack encoder
tracer: msgpack
integration: msgpack
benchmarks: pytest-benchmark
profile: pytest-benchmark
Expand Down