Skip to content

Hash-based test partitioning #586

@MatthewMckee4

Description

@MatthewMckee4

Add a hash-based partitioning mode as an alternative to the current module-aware LPT strategy:

karva test --partition hash:1/3
karva test --partition hash:2/3
karva test --partition hash:3/3

Hash-based partitioning deterministically assigns tests to buckets based on their name hash. The key advantage is stability — adding or removing a test only affects its own bucket, not the distribution of all other tests. This is useful when partitions have costly setup that you don't want invalidated by test changes.

The current LPT partitioning is better for load balancing; hash partitioning trades balance for stability.

See: https://nexte.st/docs/ci-features/partitioning/

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciRelated to internal CI toolingtest-runningRelated to running tests with karva

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions