Releases: AlexB52/retest
Remove the --auto option and update help text
Change starting sound and copy changes
Enable Sound Feedback
For macOS only (for now)
You can now get sound feedback when your tests pass or fail.
Add the --notify
flag on your retest command to enable sound. You should hear a sound as your start Retest and on all the runs.
Why? This removes the need to see the terminal window while refactoring code. 🎉
Here are some valid uses of the notify flag:
$ retest --notify
$ retest --all --notify
$ retest --notify 'ruby <changed>'
This release includes:
Add <changed> placeholder
This releases allows the developer to use the placeholder in the retest command. Something like this: retest 'bin/rails <test> && rubocop <changed>
This command will both find the matching test, the changed file and replace the placeholders accordingly.
Retest can be used with <test>
and/or <changed>
retest 'rubocop <changed>'
retest 'bin/rails test <test>'
retest 'bin/rails test <test> && rubocop <changed>'
retest 'bin/rails test <test> && rubocop <test> <changed>'
Rules
If we have a post.rb
and post_test.rb
files. Here are the different scenarios and rules:
A change on post.rb
results in:
<changed> => post.rb
<test> => post_test.rb
A change on post_test.rb
results in:
<changed> => post_test.rb
<test> => post_test.rb
Add --ext argument
This release includes the ability to listen to other extensions than the /\.rb$/
regex.
For now, this extension is really just useful for hardcoded commands. An example of usage can be:
$ retest 'go test' --ext=\\.go$
This is a first step towards opening retest to other programming languages.
Note: Using placeholders e.g. <test>
will probably not work as finding test files is still coupled to ruby extensions. We'll look into changing this in future releases.
Run diffs in one go
The flag --diff
now runs all the spec files in one run instead of looping through each of them.
Example:
retest --diff main
Setup identified: [RSPEC]. Using command: 'bin/rspec <test>'
Tests found:
- spec/path/to/file1_spec.rb
- spec/path/to/file2_spec.rb
- spec/path/to/file3_spec.rb
Running tests...
Test File Selected: spec/path/to/file1_spec.rb spec/path/to/file2_spec.rb spec/path/to/file3_spec.rb
Running via Spring preloader in process 10493
................................................................................................................................................................................................................
Finished in 16.97 seconds (files took 0.69523 seconds to load)
208 examples, 0 failures
Add support for a ruby project without Gemfile
Retest auto flag will now find the correct command to run automatically with a ruby folder without a Gemfile.
Something as simple as:
ruby-bare
├── program.rb
└── program_test.rb
0 directories, 2 files
Bin commands
This release includes a performance boost using /bin/
files rather than bundle exec
commands when possible.
When your ruby repository has a bin file such as bin/rake
, bin/rspec
, bin/rails
this file will be used instead of its corresponding bundle exec command.
Diff Feature
This release includes a new feature: Diff feature used with the --diff
option.
It helps you run a sanity check only on specs related your current changes against a branch. So that you don't run the whole suite locally but still gets a check before triggering a full CI suite once pushed.
retest --diff origin/main
The release also has minor improvements on file search depending on the command you run