A Ruby gem that splits tests evenly across parallel CI nodes to speed up test suite execution.
Knapsack is a Ruby gem that optimizes test suite execution in CI/CD pipelines by splitting tests across parallel nodes. It solves the problem of slow CI builds by distributing tests based on their historical execution times, ensuring balanced workloads and faster feedback loops. The tool integrates seamlessly with popular Ruby test frameworks and CI providers without requiring changes to your test code.
Ruby developers and teams using RSpec, Cucumber, Minitest, or similar test frameworks in CI environments like CircleCI, Travis CI, or GitLab CI. It's particularly valuable for projects with large test suites where build times are a bottleneck.
Developers choose Knapsack for its simplicity and effectiveness in reducing CI build times without switching test runners or CI providers. Its static splitting based on actual execution data provides reliable performance improvements, and its open-source nature offers a free alternative to commercial parallel testing services.
Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works with RSpec, Cucumber, Minitest, Spinach, and Turnip without replacing your existing test runner, as shown in the adapter binding examples in the README.
Uses pre-generated JSON reports of test execution times to distribute tests evenly across CI nodes, reducing overall build duration by balancing workloads.
Compatible with CircleCI, Travis CI, GitLab CI, Jenkins, and others via environment variables, with detailed setup guides provided for each provider.
Allows adjustment of test file patterns, report paths, log levels, and time offset warnings to fit various project structures and needs.
The gem is no longer actively maintained and is archived, with the developers pushing users towards the paid Knapsack Pro service, risking future compatibility issues.
Lacks dynamic test splitting, meaning it cannot adapt to real-time changes in test execution times, leading to potential imbalances with new or modified tests.
Requires manual generation and version control of execution time reports via KNAPSACK_GENERATE_REPORT, adding overhead and maintenance compared to automated solutions.