A simple CLI to watch file changes and run their matching Ruby specs. Works on any ruby projects with no setup.
MIT License
This release fixes on our CI pipeline and the bundler version set incorrectly in the previous release v1.13.1
Published by AlexB52 8 months ago
Ruby 3.4 will require the observer
gem to be set as an explicit dependency in a Gemfile and will no longer be included in the language: https://bugs.ruby-lang.org/issues/20187
This release adds observer gem as an explicit Retest dependency.
Published by AlexB52 8 months ago
In this release, apparent changes are on the list of possible options:
>
at the end to improve user feedback #192The list looks like this now
We found few tests matching: app/models/valuation/holdings.rb
[0] - test/models/taxation/holdings_test.rb
[1] - test/models/schedule/holdings_test.rb
[2] - test/models/holdings_test.rb
[3] - test/models/performance/holdings_test.rb
[4] - test/lib/csv_report/holdings_test.rb
[5] - none
Which file do you want to use?
Enter the file number now:
>
In minor improvements with no impact
Published by AlexB52 11 months ago
This release adds a few changes
--notify
, retest is now making a sound after asking to select a file when in doubtListen.logger
dependency and available with LISTEN_GEM_DEBUGGING=warn
--verbose
, -v` to see which version of retest we're currently usingThese issues are fixed:
Published by AlexB52 about 1 year ago
The release improves the identification of test files with test
and spec
prefix or suffix.
The release also updates some dependencies suggested by Dependabot.
Main change:
Published by AlexB52 about 2 years ago
Since December 2021, Bundler gem now defaults to test_filename.rb
instead of filename_test.rb
in release 2.3.0
bundle gem generated MiniTest file and class now start with 'test' https://github.com/rubygems/rubygems/pull/3893
This release addresses this change by updating what's considered a test file when matching specs.
A change in filename.rb
will now consider these files as possible matches:
filename_test.rb
filename_spec.rb
test_filename.rb
spec_filename.rb
(because why not)Published by AlexB52 over 2 years ago
Someone suggested to gracefully exit Retest
when pressing ctrl
+ c
instead of showing the ruby trace: #124
This release enables the software to print "Goodbye" after exiting retest.
Published by AlexB52 over 2 years ago
Some filesystems won't work without polling (VM/Vagrant Shared folders, NFS, Samba, sshfs, etc.).
https://github.com/guard/listen#issues--limitations
In this situation we introduce a new flag --polling
to force the polling method on the Listen
gem when using retest
Examples:
$ retest --polling
$ retest --polling --all
$ retest --polling 'bundle exec rubocop <changed>'
Published by AlexB52 over 2 years ago
The --auto option is run by default, there is no need to make it explicit.
retest -h
# Old behaviour
$ retest --auto
$ retest --auto --all
# New behaviour
$ retest
$ retest --all
This release fixes:
Published by AlexB52 over 2 years ago
We play another sound when restest starts.
Using the same sound of a test passing and retest starting is confusing.
The sounds should be distinct otherwise it feels like Retest ran the suite.
A minor change updating a copy to make things a bit clearer.
This release includes:
#108
#112
Fixing:
#82
Published by AlexB52 over 2 years ago
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:
Published by AlexB52 about 3 years ago
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>'
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
Published by AlexB52 about 3 years ago
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.
Published by AlexB52 about 3 years ago
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
Published by AlexB52 over 3 years ago
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
Published by AlexB52 over 3 years ago
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.
Published by AlexB52 over 3 years ago
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
Published by AlexB52 over 3 years ago
You can now run retest without passing a command in quotes and retest will find out the appropriate command to run.
Works with --all
flag too. Examples:
retest
retest --all
retest --auto
retest --auto --all
Those are equivalent
retest
retest --auto
Published by AlexB52 over 3 years ago
This release has no impact on the current retest CLI but is really exciting! 🙌
We now have a reliable setup to test retest CLI in different ruby environments. So far there are three environments:
Those E2E tests will increase our confidence in providing a stable and 'it just works' experience moving forward with development ❤️
Published by AlexB52 over 3 years ago
Retest now watches untracked files from a repository after launch on top of adding new files and deleting files when running.