{"id":13878981,"url":"https://github.com/renderedtext/test-boosters","last_synced_at":"2025-04-05T03:06:13.440Z","repository":{"id":44897892,"uuid":"81923256","full_name":"renderedtext/test-boosters","owner":"renderedtext","description":"Auto Parallelization - runs test files in multiple jobs","archived":false,"fork":false,"pushed_at":"2023-09-19T00:43:40.000Z","size":263,"stargazers_count":56,"open_issues_count":18,"forks_count":41,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T02:03:38.515Z","etag":null,"topics":["booster","knapsack","knapsack-solver","semaphore-open-source"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renderedtext.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-14T08:32:50.000Z","updated_at":"2025-03-04T07:12:54.000Z","dependencies_parsed_at":"2024-01-13T20:56:27.448Z","dependency_job_id":"cc86e787-de13-4f23-b33f-2c9bca7aee4d","html_url":"https://github.com/renderedtext/test-boosters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Ftest-boosters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Ftest-boosters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Ftest-boosters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Ftest-boosters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renderedtext","download_url":"https://codeload.github.com/renderedtext/test-boosters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280263,"owners_count":20912967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["booster","knapsack","knapsack-solver","semaphore-open-source"],"created_at":"2024-08-06T08:02:06.017Z","updated_at":"2025-04-05T03:06:13.420Z","avatar_url":"https://github.com/renderedtext.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Test Boosters\n\n[![Gem Version](https://badge.fury.io/rb/semaphore_test_boosters.svg)](https://badge.fury.io/rb/semaphore_test_boosters)\n[![Build Status](https://semaphoreci.com/api/v1/renderedtext/test-boosters/branches/master/badge.svg)](https://semaphoreci.com/renderedtext/test-boosters)\n\nAuto Parallelization \u0026mdash; runs test files in multiple jobs\n\n- [Installation](#installation)\n\nTest Booster basics:\n\n  - [What are Test Boosters](#what-are-test-boosters)\n  - [Split Configuration](#split-configuration)\n  - [Leftover Files](#split-configuration)\n\nTest Boosters:\n\n  - [RSpec Booster](#rspec-booster)\n  - [Cucumber Booster](#cucumber-booster)\n  - [Minitest Booster](#minitest-booster)\n  - [ExUnit Booster](#ex-unit-booster)\n  - [GoTest Booster](#go-test-booster)\n\n## Installation\n\n``` bash\ngem install semaphore_test_boosters\n````\n\n## What are Test Boosters\n\nTest Boosters take your test suite and split the test files into multiple jobs.\nThis allows you to quickly parallelize your test suite across multiple build\nmachines.\n\nAs an example, let's take a look at the `rspec_booster --job 1/10` command. It\nlists all the files that match the `spec/**/*_spec.rb` glob in your project,\ndistributes them into 10 jobs, and execute the first job.\n\n### Split Configuration\n\nEvery test booster can load a split configuration file that helps the test\nbooster to make a better distribution.\n\nFor example, if you have 3 RSpec Booster jobs, and you want to run:\n\n- `spec/a_spec.rb` and `spec/b_spec.rb` in the first job\n- `spec/c_spec.rb` and `spec/d_spec.rb` in the second job\n- `spec/e_spec.rb` in the third job\n\nyou should put the following in your split configuration file:\n\n``` json\n[\n  { \"files\": [\"spec/a_spec.rb\", \"spec/b_spec.rb\"] },\n  { \"files\": [\"spec/c_spec.rb\", \"spec/d_spec.rb\"] },\n  { \"files\": [\"spec/e_spec.rb\"] }\n]\n```\n\nSemaphore Classic uses Split configurations to split your test files based on their\ndurations in the previous builds.\n\n**NOTE**\n\nDistributing tests based on their duration is not supported in Semaphore 2.0.\nIf you use Semaphore 2.0, provide a split configuration file to achieve the best performance.\n\n### Leftover Files\n\nFiles that are part of your test suite, but are not in the split\nconfiguration file, are called \"leftover files\". These files will be distributed\nbased on their file size in a round robin fashion across your jobs.\n\nFor example, if you have the following in your split configuration:\n\n``` json\n[\n  { \"files\": [\"spec/a_spec.rb\"] }\n  { \"files\": [\"spec/b_spec.rb\"] }\n  { \"files\": [\"spec/c_spec.rb\"] }\n]\n```\n\nand the following files in your spec directory:\n\n``` bash\n# Files from split configuration ↓\n\nspec/a_spec.rb\nspec/b_spec.rb\nspec/c_spec.rb\n\n# Leftover files ↓\n\nspec/d_spec.rb\nspec/e_spec.rb\n```\n\nWhen you run the `rspec_booster --job 1/3` command, the files from the\nconfiguration's first job and some leftover files will be executed.\n\n``` bash\nrspec_booster --job 1/3\n\n# =\u003e runs: bundle exec rspec spec/a_spec.rb spec/d_spec.rb\n```\n\nBooster will distribute your leftover files uniformly across jobs.\n\n## RSpec Booster\n\nThe `rspec_booster` loads all the files that match the `spec/**/*_spec.rb`\npattern and uses the `~/rspec_split_configuration.json` file to parallelize your\ntest suite.\n\nExample of running job 4 out of 32 jobs:\n\n``` bash\nrspec_booster --job 4/32\n```\n\nUnder the hood, the RSpec Booster uses the following command:\n\n``` bash\nbundle exec rspec --format documentation --format json --out /home/\u003cuser\u003e/rspec_report.json \u003cfile_list\u003e\n```\n\nOptionally, you can pass additional RSpec flags with the `TB_RSPEC_OPTIONS`\nenvironment variable. You can also set a RSpec formatter with the `TB_RSPEC_FORMATTER` environment variable.\nDefault formatter is `documentation`.\n\n\nExample:\n``` bash\nTB_RSPEC_OPTIONS='--fail-fast=3' TB_RSPEC_FORMATTER=Fivemat rspec_booster --job 4/32\n\n# will execute:\nbundle exec rspec --fail-fast=3 --format Fivemat --format json --out /home/\u003cuser\u003e/rspec_report.json \u003cfile_list\u003e\n```\n\n## Cucumber Booster\n\nThe `cucumber_booster` loads all the files that match the `features/**/*.feature`\npattern and uses the `~/cucumber_split_configuration.json` file to parallelize\nyour test suite.\n\nExample of running job 4 out of 32 jobs:\n\n``` bash\ncucumber_booster --job 4/32\n```\n\nUnder the hood, the Cucumber Booster uses the following command:\n\n``` bash\nbundle exec cucumber \u003cfile_list\u003e\n```\n\n## Minitest Booster\n\nThe `minitest_booster` loads all the files that match the `test/**/*_test.rb`\npattern and uses the `~/minitest_split_configuration.json` file to parallelize\nyour test suite.\n\nExample of running job 4 out of 32 jobs:\n\n``` bash\nminitest_booster --job 4/32\n```\n\nIf minitest booster is executed in a scope of a Rails project, the following is\nexecuted:\n\n``` bash\nbundle exec rails test \u003cfile_list\u003e\n```\n\nIf minitest booster is running outside of a Rails project, the following is\nexecuted:\n\n``` bash\nruby -e 'ARGV.each { |f| require \".#{f}\" }' \u003cfile_list\u003e\n```\n\nIf you want to run a custom command for minitest, use the\n`MINITEST_BOOSTER_COMMAND` environment variable:\n\n``` bash\nexport MINITEST_BOOSTER_COMMAND=\"bundle exec rake test\"\n\nminitest_booster --job 1/42\n```\n\n## ExUnit Booster\n\nThe `ex_unit_booster` loads all the files that match the `test/**/*_test.exs`\npattern and uses the `~/ex_unit_split_configuration.json` file to parallelize\nyour test suite.\n\nExample of running job 4 out of 32 jobs:\n\n``` bash\nex_unit_booster --job 4/32\n```\n\nUnder the hood, the ExUnit Booster uses the following command:\n\n``` bash\nmix test \u003cfile_list\u003e\n```\n\n## Go Test Booster\n\nThe `go_test_booster` loads all the files that match the `**/*_test.go`\npattern and uses the `~/go_test_split_configuration.json` file to parallelize\nyour test suite.\n\nExample of running job 4 out of 32 jobs:\n\n``` bash\ngo_test_booster --job 4/32\n```\n\nUnder the hood, the Go Test Booster uses the following command:\n\n``` bash\ngo test \u003cfile_list\u003e\n```\n\n## Development\n\n### Integration testing\n\nFor integration tests we use test repositories that are located in\n\u003chttps://github.com/renderedtext/test-boosters-tests.git\u003e.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/renderedtext/test-boosters.\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderedtext%2Ftest-boosters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenderedtext%2Ftest-boosters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderedtext%2Ftest-boosters/lists"}