Use teamcity cucumber formatter with not rake runner
Hello,
I would like to use teamcity cucumber formatter with command line.
The main reason for this is that i need to lauch cucumber tests through xvfb-run command.
My settings:
I set teamcity env.RUBYLIB with value %system.agent.home.dir%/plugins/rake-runner/rb/patch/common;%system.agent.home.dir%/plugins/rake-runner/rb/patch/bdd
Run tests with options --format TeamCity::Cucumber::Formatter -expand
Build fails with messages:
cannot load such file -- team_city/cucumber/formatter
Error creating formatter: TeamCity::Cucumber::Formatter (LoadError)
Any help?
Thanks in advance!
Please sign in to leave a comment.
Hi Andrey,
It's not documented and not supported, but you can use that approach.
Note semicolon (:) should be used to separate folders in RUBYLIB. (at least in unix)
Proper fomatter name is 'Teamcity::Cucumber::Formatter' (note 'c' in lower case)
BTW: Why don't you use rake-runner?
Also you can wrap running of all build steps using runas plugin. So you can configure your build as rake-runner step and runas feature to wrap all executions with xvfb-run.
Regards,
Vladislav.
Hello, Vladislav!
Thanks for reply.
I fixed RUBYLIB variable and formatter namespace, but i am still facing the same problem:
The command line i ran is 'xvfb-run bundle exec cucumber --expand --format Teamcity::Cucumber::Formatter'
I will try the solution with rake runner you suggested and will write results here.
Thanks!
I ran command line: xvfb-run bundle exec cucumber --expand --format Teamcity::Cucumber::Formatter --require %system.agent.home.dir%/plugins/rake-runner/rb/patch/bdd
And got the another error:
May be it will help you to investigate what the problem is.
Thanks!
I tuned the tests run with rake through xvfb with ranas plugin, but i don't see real-time tests progress of the build, and there are no teamcity test service messages in the build log.
Step build log:
Is it working as expected?
Thanks!
Could you please try running cucumber without xvfb-run?
I've tried next script and it works fine with TC 9.0.2:
export RUBYLIB="%system.agent.home.dir%/plugins/rake-runner/rb/patch/bdd:%system.agent.home.dir%/plugins/rake-runner/rb/patch/common"
bundle exec cucucmber --format "Teamcity::Cucumber::Formatter"
When running on agent from console do you see same behaviour?
I'm not sure how xvbf works with env variables. Will investigate it later today.
About approach with rake-runner and runas: do you see any output? is it reported at once or real-time within build process?
Hello, Vladislav!
Finally it works with export ruby lib command. Thank you very much for support!
One more question is it right that cucumber step count like single test in report?
Big thanks!
Hi Andrey,
Good to hear that.
So have you setup build with command line runner or rake-runner+runas?
About cucumber steps we have related issue: TW-30206 Watch/vote.
Regards,
Vladislav.
Vladislav,
Setup with command line runner, but i think for now there is no problem to setup with rake.
Thank you very much!