Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wbotelhos/rspeed
RSpeed splits your specs to you run parallels tests
https://github.com/wbotelhos/rspeed
parallel report rspec
Last synced: 4 months ago
JSON representation
RSpeed splits your specs to you run parallels tests
- Host: GitHub
- URL: https://github.com/wbotelhos/rspeed
- Owner: wbotelhos
- License: mit
- Created: 2017-12-31T21:51:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T16:12:24.000Z (almost 4 years ago)
- Last Synced: 2024-10-01T14:53:33.383Z (4 months ago)
- Topics: parallel, report, rspec
- Language: Ruby
- Homepage: https://www.danca.com
- Size: 347 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# RSpeed
[![CI](https://github.com/wbotelhos/rspeed/workflows/CI/badge.svg)](https://github.com/wbotelhos/rspeed/actions)
[![Gem Version](https://badge.fury.io/rb/rspeed.svg)](https://badge.fury.io/rb/rspeed)
[![Maintainability](https://api.codeclimate.com/v1/badges/f312587b4f126bb13e85/maintainability)](https://codeclimate.com/github/wbotelhos/rspeed/maintainability)
[![Coverage](https://codecov.io/gh/wbotelhos/rspeed/branch/main/graph/badge.svg)](https://codecov.io/gh/wbotelhos/rspeed)
[![Sponsor](https://img.shields.io/badge/sponsor-%3C3-green)](https://www.patreon.com/wbotelhos)RSpeed splits your specs to you run parallels tests.
## Install
Add the following code on your `Gemfile` and run `bundle install`:
```ruby
gem 'rspeed'
```## Setup
We need to extract the rake that executes the split via `rspeed:run`.
```ruby
rake rspeed:install
```## Usage
- `RSPEED_APP`: You app name to avoid data override
- `RSPEED_PIPE`: Current pipe
- `RSPEED_PIPES`: Quantity of pipes
- `RSPEED_SPEC_PATH`: The specs folders path
- `RSPEED`: Enables RSpeed```sh
RSPEED=true RSPEED_APP=blog RSPEED_PIPE=1 RSPEED_PIPES=3 bundle exec rake rspeed:run
```## How it Works
### First run
1. Since we have no statistics on the first time, we run all specs and collect it;
```json
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/4_spec.rb", "time": 1 }
```### Second and next runs
1. Previous statistics is balanced by times and distributed between pipes:
```json
{ "file": "./spec/models/4_spec.rb", "time": 1 }
``````json
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
``````json
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
```2. Run the current pipe `1`:
```json
{ "file": "./spec/models/4_spec.rb", "time": 1 }
```- Collects statistics and temporary save it;
4. Run the current pipe `2`:
```json
{ "file": "./spec/models/2_spec.rb", "time": 0.02 }
```- Collects statistics and temporary save it;
5. Run the current pipe `3`:
```json
{ "file": "./spec/models/3_spec.rb", "time": 0.001 }
{ "file": "./spec/models/1_spec.rb", "time": 0.01 }
```- Collects statistics and temporary save it;
- Sum all the last statistics and save it for the next run;