{"id":14991270,"url":"https://github.com/owen2345/rspec_chunked","last_synced_at":"2025-10-08T19:09:40.998Z","repository":{"id":56892888,"uuid":"366488696","full_name":"owen2345/rspec_chunked","owner":"owen2345","description":"This gem permits running rspec tests in parallel by chunking tests into defined groups and balancing by file size. If the default order is not enough, it permits to balance manually by moving x percentage of test files from group A into group B.","archived":false,"fork":false,"pushed_at":"2021-06-27T12:23:03.000Z","size":157,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-27T20:54:11.317Z","etag":null,"topics":["github-workflow","parallel-tests","rspec","ruby"],"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/owen2345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-11T19:13:44.000Z","updated_at":"2025-02-24T07:48:05.000Z","dependencies_parsed_at":"2022-08-20T16:10:39.751Z","dependency_job_id":null,"html_url":"https://github.com/owen2345/rspec_chunked","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/owen2345/rspec_chunked","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owen2345%2Frspec_chunked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owen2345%2Frspec_chunked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owen2345%2Frspec_chunked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owen2345%2Frspec_chunked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owen2345","download_url":"https://codeload.github.com/owen2345/rspec_chunked/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owen2345%2Frspec_chunked/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278891746,"owners_count":26063856,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["github-workflow","parallel-tests","rspec","ruby"],"created_at":"2024-09-24T14:22:04.100Z","updated_at":"2025-10-08T19:09:40.980Z","avatar_url":"https://github.com/owen2345.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RspecChunked\nThis gem permits running rspec tests in parallel by chunking tests into defined groups and balancing by file size. If the default order is not enough, it permits to balance manually by moving x percentage of test files from group A into group B.\n\n## Installation\n- Add this line to your application's Gemfile:\n```ruby\n  group :test do\n    gem 'rspec_chunked'\n  end\n```\n\n- And then execute:\n`bundle install`\n\n- Add manual balance (optional)\n  ```ruby\n    # config/rspec_chunked.rb\n    if defined?(RspecChunked::ChunkedTests)\n      data = { 1 =\u003e { to: 2, percentage: 15 },\n               4 =\u003e { to: 3, percentage: 10 } }\n      RspecChunked::ChunkedTests.balance_settings = data\n    end\n  ```\n  Balance tests by moving 15% tests files from group 1 into group 2 and moving 10% tests files from group 4 into group 3\n\n## Usage\n- Basic initialization\n  ` CI_JOBS=1/3 rake rspec_chunked`\n- Custom initialization\n  ` CI_LOGIC=qty_specs CI_JOBS=1/3 CI_CMD=\"bundle exec rspec ...\" rake rspec_chunked`\n- `CI_JOBS`: Current job number / quantity of groups/jobs to be split\n- `CI_CMD`: Custom rspec command\n- `CI_LOGIC`: Kind of logic to be used when ordering tests: `qty_specs` or `file_size` (by default `file_size`)\n\n### Coverage merge reports (when using [simplecov](https://github.com/simplecov-ruby/simplecov#merging-test-runs-under-different-execution-environments))\nThis task will merge all coverage reports\n`rake rspec_chunked:merge_reports`\n\n\n### Github workflow result\n- Before:    \n  ![Before](/docs/before.png?raw=true)\n\n- After:    \n  ![After](/docs/current.png?raw=true)   \n\n- Github workflow sample:\n  ````yaml\n  rspec_tests:\n    name: Rspec tests\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        ci_job: [ 1, 2, 3, 4 ] # enumerize jobs\n    env:\n      CI_JOBS: ${{ matrix.ci_job }}/4 # \u003ccurrent_job\u003e/\u003ctotal_jobs\u003e\n  \n    steps:\n      - uses: actions/checkout@v2\n      - name: Backend tests\n        run: docker-compose run test /bin/sh -c \"CI_JOBS=$CI_JOBS rake rspec_chunked\"\n\n  ````  \n\n## Contributing\nBug reports and pull requests are welcome on GitHub at https://github.com/owen2345/rspec_chunked. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowen2345%2Frspec_chunked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowen2345%2Frspec_chunked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowen2345%2Frspec_chunked/lists"}