My test suites are growing rapidly. Sometimes it is really hard to find
meningful test output in long and bloated test.log.
Do you have any advices or best practices when it comes to logging in
So far I have been using following policy:
Log test name in every test_* method
I have a method that puts coloured test name in the log. The problem
I have to invoke this method manually in each test method. And it
… # Rest of the test goes here
How to make Test::Unit log test name automatically?
Log failures using logger
A small replacement function for Test::Unit::Assertions::assert_block
enough to write ‘Success’ or ‘Failed: …’ in test logs.
Log everything from within tests, nothing from application.
I try to make application methods as short and clean as possible. And
means (almost) no logging in the application itself. Only some really
uncommon/strange/error situations have logging statements.
Use log when necessary, remove when no longer needed
All the introspection I do when needed in tests. And that means
logging statements from tests as soon as they are not needed - when
Do you have any thoughts or suggestions to improve my test environment?
I put my test_helper.rb here: http://textsnippets.com/posts/show/522
Recce - Requirements management made simple
My blog: http://ragnarson.blogspot.com