0

I cannot work out how to run tests in parallel in Rubymine. I'm using the parallel_tests gem, which I can get to work from the terminal but cannot work out how to get it working using Rubymines interface. I want to do this so that I can use Rubymines tools to ease test running and debuging

I've got a super simple example project, with the following step definition:

Then /^I run test (.*) for feature (.*)$/ do |test, feature|
  delay = 1 + rand(5)
  puts "Running Feature #{feature} Test #{test}. Next output in #{delay} seconds"
  sleep delay
end

This is called by two different features, each one identifies which feature is calling it and increments 'test' by 1. The purpose of this is simply to help me see that the code is being executed at the same time. When run from the terminal I get the following output, which is more or less as expected:

Feature: First feature

Feature: Second feature

  Scenario: First scenario          # features/feature_two.feature:3
    Then I run test 1 for feature 2 # features/step_definitions/parallel_test_steps.rb:1
      Running Feature 2 Test 1. Next output in 3 seconds
  Scenario: First scenario          # features/feature_one.feature:3
    Then I run test 1 for feature 1 # features/step_definitions/parallel_test_steps.rb:1
      Running Feature 1 Test 1. Next output in 5 seconds
    Then I run test 2 for feature 2 # features/step_definitions/parallel_test_steps.rb:1
      Running Feature 2 Test 2. Next output in 3 seconds
    Then I run test 2 for feature 1 # features/step_definitions/parallel_test_steps.rb:1
      Running Feature 1 Test 2. Next output in 4 seconds

...

However, I'm having trouble getting this to work in Rubymine. To get the aforementioned result the command used is bundle exec parallel_cucumber features/, I cannot work out how to set up a run configuration which performs this. I'm aware of the "Run the script in context of the bundle (bundle exec)" option, however this just prepends "bundle exec" before the regular run command, which does not behave as desired.

Brayw
  • 125
  • 5
  • Have you tried creating a Gem command Run configuration? https://www.jetbrains.com/help/ruby/run-debug-configuration-gem-command.html – Olivia Jun 05 '19 at 19:34
  • @Olivia I'm not sure I understand you, I don't want to create a gem so I'm not sure how this would help me – Brayw Jun 06 '19 at 09:34
  • it's not about creating a gem but about creating a run configuration for executing a custom (parallel_tests for example) Ruby gem. – Olivia Jun 06 '19 at 19:59
  • Oh, I had misunderstood the purpose of that run config, I'll take another look. Thank you for your help – Brayw Jun 07 '19 at 07:37
  • @Olivia Rubymine complains that I need to specify the gem executable, but I'm not 100% sure on what the configuration is expecting (I've put the gem name as parallel_tests, with an argument specifying the features directory and the bundle exec option selected, not sure if this is correct however) – Brayw Jun 07 '19 at 09:09
  • In case this gem has been added to the Gemfile RubyMine will propose to complete its name and executable in the corresponding fields. – Olivia Jun 13 '19 at 19:43

0 Answers0