Skip to main content

DryCI - Test caching system

This pytest plugin speeds up test runs by caching test results. It calculates a hash of the contents of all files that might affect the test results, and looks up the result in a central server.

This repository contains both the pytest plugin and a reference server.

This solution is a lightweight alternative to the test-caching part of heavy hermetic build systems like Bazel or Buck. It is designed to be easy to set up and use, and to work with existing projects without requiring full-time engineers to manage it.

User documentation, a public cache server, a hermeticity verifier, and more language support might come in the future.

How to use

  1. Add the pytest-dryci package to your dev-dependencies.
  2. Configure repo_dagger.yaml, see example_project for inspiration.
  3. Obtain a DryCI token for a DryCI server. The public instance is currently in closed beta, but you may deploy your own.
  4. Run DRYCI_TOKEN=$your_token_here pytest --dryci ./tests.

You may also specify DRYCI_SERVER to use a custom server, DRYCI_SALT to do cache-busting, and DRYCI_TIMEOUT to control http timeouts.

How it works

The plugin runs repo_dagger to analyze the runtime dependencies of all files that might affect the test results. To do this effectively, you will need to configure rules that define dependencies between files in repo_dagger.yaml. See example_config.toml for an example config.

A dependency graph between project files

Then, for each file in the test suite, it traverses the dependency graph and hashes each file. The hash of all these files is known as the "dependency hash" of the test file. The hash also includes some info about the system, such as the operating system, distro, architecture, and the contents of the DRYCI_SALT environment variable.

A hash function hashing the dependencies from the graph above

It then queries the server for the list of passed tests for each dependency hash, and skips any tests it returns. Test identifiers (pytest nodeids) are salted and hashed for privacy.

Note that failed tests are never cached, so flaky tests get a chance to run again. Skipped tests are also not cached, but that might change in the future.

A computer queries the server what tests need to run, and which should be skipped

After running the test suite, we upload the (hashed) identifier of each test that passed, so future runs can skip them.

A computer uploads hashes of passed tests to the server

Release files for pytest-dryci 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pytest-dryci 0.1.1
File
pytest_dryci-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.1+ x86-64 Details
pytest_dryci-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux musl 1.1+ ARM64 Details
pytest_dryci-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
pytest_dryci-0.1.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 9.2 MB

Release files / pytest_dryci-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL pytest_dryci-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Size 2.4 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ac7882944922ae336c9051d4dab4ec4ee1bfc4a86267ec70dd751f8871e12038
BLAKE2b-256 checksum
How to use checksums
3f2dac325f93a5ac46d912d23bad80f85c16aeec0b938fc0fd61e0f187b7e054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.20

Release files / pytest_dryci-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL pytest_dryci-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 2.2 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
08760412ead53d884560d674f7988b63230fd24570ec41bf8d8ca2a9cfe50545
BLAKE2b-256 checksum
How to use checksums
11f2cca7589dbc97e176083726c3c057a61db6d8a7b57ffd4b121662196ab489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.20

Release files / pytest_dryci-0.1.1-py3-none-macosx_11_0_arm64.whl

Download URL pytest_dryci-0.1.1-py3-none-macosx_11_0_arm64.whl
Size 2.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d26177aaba653b8ef0a54b89b04d6ba88166bae28d68788d8ccd8a146424e709
BLAKE2b-256 checksum
How to use checksums
d51053a7312e4c13deccf6020d95614d0e9d973330110ba5809eee545d505b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.20

Release files / pytest_dryci-0.1.1-py3-none-macosx_10_12_x86_64.whl

Download URL pytest_dryci-0.1.1-py3-none-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7580d4ea3194904f2a610673809939e83a90467a7283bbe4ddbc3f08c0e53f6e
BLAKE2b-256 checksum
How to use checksums
11a3245ee1d22570e7b0bb3542cd3162391cf1b1a5419ae6b91aceea7241208a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.20

Release history Release notifications | RSS feed

This release

0.1.1 This release

4 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page