Exclude parameter on rails tests doesn't seem to work?

The rails test runner has an 'exclude' options that lets the user exclude certain tests in a test run (https://edgeguides.rubyonrails.org/testing.html#the-rails-test-runner).

On the CLI this command works and excludes all tests where the name matches the regex:

rails test --exclude /^some_test_name_regex.+$/

However, this option does not seem to work in the test configuration in RubyMine?

0
5 comments

Hello Patrick,

could you please specify how your Run configuration and the command being run with it look like?

0
Avatar
Permanently deleted user

Hi Olga,

The command I want to run is `rails test --exclude /^test_real_data_.+$/` (i.e run all tests except the ones where the test name matches that regular expression, see https://edgeguides.rubyonrails.org/testing.html#the-rails-test-runner)

In my Run configuration under Rake task, I put "--exclude /^test_real_data_.+$/" into the "Arguments" field.

The command generated by RubyMine is: bin/spring rails '\"'\"'test[--exclude /^test_real_data_.+$/]'\"'\"'

RubyMine still runs all tests in the suite (i.e. it ignores the "exclude" parameter)

0
Avatar
Permanently deleted user

Hi Olga Kuvardina

Is there any update on this issue? Would be good to know whether my syntax is incorrect or whether Rubymine currently does not support the `exclude` parameter on tests with a regular expression.

0

Hi Patrick,

you can use Minitest/Test::Unit run configuration and specify there exclude in the Runner options field.

0
Avatar
Permanently deleted user

Ah that works. Many thanks

0

Please sign in to leave a comment.