##teamcity output when running tests using Guard

Answered

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
Started


##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'
end

My Guardfile:

guard :minitest do
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
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' }
end
13 comments
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 ?

1
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.

0
Comment actions Permalink

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

0
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?

0
Comment actions Permalink

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

0
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!

0
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.

0
Comment actions Permalink

Thank you, Richard, a project would be great.

0
Comment actions Permalink

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

https://github.com/rmoehn/rubymine-mfe

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

 

 

0
Comment actions Permalink

Hello Richard,

sorry for not getting back to you earlier. Thank you for the project, I managed to reproduce the problem (used Gem command Run Configuration instead) and submitted an issue for that:

https://youtrack.jetbrains.com/issue/RUBY-29200

1
Comment actions Permalink

Great, thank you!

0
Comment actions Permalink

Hello Richard,

My colleague has left a comment on the issue (https://youtrack.jetbrains.com/issue/RUBY-29200#focus=Comments-27-5721053.0-0) Could you please take a look at it.

0
Comment actions Permalink

I replied, but I couldn't contribute much.

0

Please sign in to leave a comment.