Skip to main content

Smart Test Selector — given a code change, decide which tests must run.

Project description

Smart Test Selector (sts)

Given a PR diff, decide which tests must run, which should run, and which can safely skip.

sts is the Wave 1 revenue product of the DevTrust connected platform. It consumes the codebase architecture model produced by Repo X-ray and applies deterministic, repo-aware heuristics to select an effective subset of the test suite.

Why

CI pipelines run the entire test suite on every PR because nobody trusts "affected tests" detection. Builds take 30+ minutes. Developers ship less. The ROI is direct: minutes saved per PR × PRs per week × engineer cost. A measurable, real-money problem.

What v0.0.1 does

  • Reads a list of changed files (from CLI args, a file, or unified diff).
  • Identifies test files using framework patterns (pytest, jest/vitest, gotest, cargo).
  • Classifies each test as must-run, should-run, or can-skip with a reason.
  • Emits a JSON report (machine-consumable) and a terminal table (human-readable).

Heuristics in v0.0.1

  1. Manifest changed (pyproject.toml, package.json, Cargo.toml, go.mod, lockfiles) → run all tests. Dependency drift can break anything.
  2. A test file was directly modified → run that test.
  3. A non-test source file was modified → run sibling tests:
    • Tests in the same directory.
    • Tests matching naming conventions (test_<name>.py, <name>.test.ts, <name>_test.go).
    • Tests in the corresponding tests/ subtree mirroring src/.
  4. No affected tests detected for a changed file → mark all tests should-run (safe default; never silently skip on uncertainty).

Call-graph-aware affecting (which test transitively imports the changed module) lands in v0.1 once Repo X-ray v0.2 ships its call graph.

CLI

sts version
sts select --repo .                      # auto-detect changed files via git
sts select --repo . --changed src/foo.py src/bar.py
sts select --repo . --diff changes.diff
sts info --repo .                        # quick stats: how many tests, by framework

Output: a JSON report at .sts/selection.json and a terminal table.

Status

v0.0.1: alpha. Apache-2.0. See CHANGELOG.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devtrust_sts-0.0.3.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devtrust_sts-0.0.3-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file devtrust_sts-0.0.3.tar.gz.

File metadata

  • Download URL: devtrust_sts-0.0.3.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devtrust_sts-0.0.3.tar.gz
Algorithm Hash digest
SHA256 085ec3e1990d5c7556ec4c8ee4ed6cee6001fbcf043279075f8fae0863c740e0
MD5 9d45bd148740146f1d14b11e54968a54
BLAKE2b-256 9b870354becd1359b869c48814a83f5f568ef56caf364e2b37bd6536b1f2ec97

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtrust_sts-0.0.3.tar.gz:

Publisher: release.yml on AbdullahBakir97/DevTrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devtrust_sts-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: devtrust_sts-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devtrust_sts-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b489471665ba0dc7045d859e7a31fd1638a8efa3c9bc65c0dd2bbca8e8a51ce0
MD5 ed7ac8dc8c6dc8b4e693545bcfd81f93
BLAKE2b-256 35a3d8a3517db146afc49548e849cf5be5c84d4a2dc201c13c953c034f782d9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtrust_sts-0.0.3-py3-none-any.whl:

Publisher: release.yml on AbdullahBakir97/DevTrust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page