##teamcity output when running tests using Guard


When I start the Guard test runner from RubyMine 2020.1.3, the output consists of verbose messages in TeamCity format:

/usr/local/bin/bash -c "/Users/erle/.rvm/bin/rvm ruby-2.4.5 do /Users/erle/.rvm/gems/ruby-2.4.5/bin/bundle exec /Users/erle/.rvm/rubies/ruby-2.4.5/bin/ruby /Users/erle/.rvm/gems/ruby-2.4.5@guided_track_rails_4/bin/guard"
14:19:04 - INFO - Guard::Minitest 2.4.6 is running, with Minitest::Unit 5.10.3!
14:19:04 - INFO - Running: all tests

##teamcity[enteredTheMatrix timestamp = '2020-07-20T14:19:05.341+0900']

##teamcity[testCount count = '0' timestamp = '2020-07-20T14:19:05.341+0900']

##teamcity[testStarted name = 'test_cannot_be_initialized_without_content' captureStandardOutput = 'true' locationHint = 'ruby_minitest_qn://TestBodyNode.test_cannot_be_initialized_without_content' timestamp = '2020-07-20T14:19:05.357+0900']

##teamcity[testFinished name = 'test_cannot_be_initialized_without_content' duration = '0' timestamp = '2020-07-20T14:19:05.357+0900']

##teamcity[testStarted name = 'test_can_be_initialized_with_no_attributes' captureStandardOutput = 'true' locationHint = 'ruby_minitest_qn://TestBodyNode.test_can_be_initialized_with_no_attributes' timestamp = '2020-07-20T14:19:05.358+0900']

##teamcity[testFinished name = 'test_can_be_initialized_with_no_attributes' duration = '0' timestamp = '2020-07-20T14:19:05.358+0900']

When I run ‘bundle exec guard’ in the terminal, it works fine.

I've dug through many of the issues that involve TeamCity and test output. I've also renamed my test files to follow the pattern ‘…test.rb’ instead of ‘test….rb’. – No luck.

My run configuration looks like this:

My Gemfile:

source "http://rubygems.org"

gem 'jeweler'
gem 'parslet'
gem 'test-unit'
gem 'minitest'
gem 'flexmock'
gem 'sanitize'

group :development do
gem 'guard'
gem 'guard-minitest'

My Guardfile:

guard :minitest do
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^lib/guided_track/(?:content|attribute)_nodes/([^/]+)\.rb$}) { |m| "test/guided_track/nodes/test_#{m[1]}_node.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
Comment actions Permalink

Hello Richard,

just to be sure, how does it go in case you add 'minitest-reporters' gem as it's specified here: https://www.jetbrains.com/help/ruby/testing-frameworks.html#supported_frameworks ?

Comment actions Permalink

Thanks for the hint, Olga! I had indeed not done that. Unfortunately, the ##teamcity output still appears as before. The changes only make the test output look nicer in the terminal, and add colours to the output in RubyMine.

Comment actions Permalink

Why is this question marked as ‘answered’? It's not answered yet. The problem is still the same.

Comment actions Permalink

Hello Richard, 

it's not marked as completed so please don't worry. As for the issue, would it be possible to share the project in question or provide a sample for reproduce?

Comment actions Permalink

I will try to put together a minimum example on Monday.

Comment actions Permalink

Now it works – it gives me the unfiltered Guard output. I didn't change anything in the project directory and settings. Just created some other projects to come up with a minimum failing example. So I'm not sure why RubyMine didn't want to play along right away.

Thanks for your help!

Comment actions Permalink

…and now it has reverted to not working. I will try again to create a minimal failing example.

I notice that RubyMine misbehaves in various ways when I try to create Run Configurations for tests using Spring or Guard. It's a pity, because fast test feedback is central to my development workflow.

Comment actions Permalink

Thank you, Richard, a project would be great.

Comment actions Permalink

Here is an example of a project where the problem occurs:


It’s a freshly generated Rails 4.2.11 application with only a few additions.




Please sign in to leave a comment.