-
Notifications
You must be signed in to change notification settings - Fork 44
Debugging RedDeer
From time to time you can observed unexpected behavior that is not caused by your code but by a bug in RedDeer itself. This chapter covers some basic approaches of howto find a problem and gather enough information for issue reporting or fixing a problem
You have several ways that could help you to diagnose the issue:
- examining log debug and error messages
- debugging code with Eclipse (with or without maven)
- enable pausing of failed tests and examine running test @since 0.4
- check screenshot or screencast @since 0.5
There is a standard RedDeer log produced on in your primary output (either terminal or Eclipse console view).
INFO [thread][class] Log message-1
INFO [thread][class] Log message-n
...
ERROR [thread][class] Something bad and unexpected happened
DEBUG [thread][class] Some additional debug information
INFO [thread][class] Log message-n+1
Debug log is enabled by default. When you don't want to see debug and trace messages in your log you can disable it by setting vm variable logDebug
to false either in eclipse or as a part of your mvn command.
mvn clean verify -DlogDebug=false
Then after test restart you should not see debug messages anymore.
Sometimes you know there are failing test but you would like to check IDE state when such test fails. There is an option for it. Just add pauseFailedTest=true
into your VMarguments in Eclispe or mvn command line so for example you can run you test like this
mvn clean verify -DpauseFailedTest=true
Once test failes, it hooks to RedDeer watch dog and test exeuction is paused until resumed by pressing [Enter]
key.
Of course you can also use Eclipse debugger and set your breakpoints to track cause of the problem right in the source code. But this is not specific so you can follow some good tutorial on the web for example this one
Debugging via maven is simple, you just need to run maven with -DdebugPort=<debug_port> like this, for example
mvn clean install -DdebugPort=8000
Then set your breakpoints and attach to the running process from IDE
To enable automatic saving of screencasts of failed tests vm variable recordScreenCast
has to be set to true either in Eclipse Run configurations or from command line for maven
-DrecordScreenCast=true
Screencasts are stored in screencast subdirectory of particular test plugin