diff --git a/.circleci/config.yml b/.circleci/config.yml index 07f2165e38b..f8cffd10079 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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: @@ -292,8 +329,8 @@ jobs: tracer: executor: ddtrace_dev steps: - - run_tox_scenario: - pattern: '^py..-tracer' + - run_test: + pattern: "tracer" opentracer: executor: ddtrace_dev @@ -803,6 +840,7 @@ requires_pre_test: &requires_pre_test - black - flake8 - ccheck + - build_base requires_tests: &requires_tests - build_docs @@ -893,6 +931,7 @@ workflows: - black - flake8 - ccheck + - build_base # Test building the package - test_build_alpine: *requires_pre_test @@ -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 diff --git a/Dockerfile b/Dockerfile index bb1693afe92..16811a9a00e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/riotfile.py b/riotfile.py new file mode 100644 index 00000000000..9d200b41d68 --- /dev/null +++ b/riotfile.py @@ -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", [""])], + ), + ], + ), +] diff --git a/tox.ini b/tox.ini index 68fa3b09f6c..f2400b6af11 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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