Skip to content

How to Run Red Deer Tests in a Jenkins Environment

jpeterka edited this page Apr 22, 2015 · 6 revisions

How to Run Red Deer Tests in a Jenkins Environment

Configure VNC

The Jenkins job configuration must enable VNC by selecting this Build Environment variable: "Run Xvnc during build"

##Maven Options Specific to Red Deer If you want to change any of the default Red Deer properties for your test, you must set them in the maven goal definition. For Red Deer properties and their default values you can check this page

For example: -DrecordScreenCast=false

Pom File Settings, MANIFEST.MF File Settings

No changes are required to these files. The same settings used to run Red Deer tests from a shell are used when Red Deer tests are run in Jenkins.

Debugging Failures

If your Red Deer test fails, there are multiple places to look for debugging information

###Red Deer Debug Logging By default, Red Deer creates a DEBUG level log whenever a test is run. The log is written to stdout when you run tests from a shell and to the console view when you run tests in Eclipse.

You can view this log through the console output for Jenkins jobs.

Check more for logging and debugging here

###Automatic Screenshots for Failed Tests

As is the case with debug logging, screenshot saving for failed tests is enabled by default by Red Deer. What happens is that when a Red Deer test fails, at the point of failure a screenshot is taken and stored for you. The screenshot illustrates the state of the UI when the test failure occured. By default, Red Deer saves the screenshot files in the “target/screenshot” directory. You can select the directory into which Red Deer will save the screenshot files by setting this JVM argument: relativeScreenshotDirectory

These screenshot files are saved in the workspace for Jenkins jobs.

###Recording Screencasts

Up to now, the Red Deer debugging features that we’ve discussed have all had one characteristic in common; they all require that you run the test and manually observe the results. This means that for an error that is subtle and difficult to track, you have may have to rerun the test several times in order to be able to see the error. It would be more helpful if you had an easy way to pause the execution of the test at the point where it fails and “rewind” the execution to a point before the failure, without having to take the time, and occupy system resources, to rerun the test from its beginning.

Red Deer solves this problem by enabling you to save a screencast of all failed tests. Red Deer performs the screencast captures through an extension of the org.monte.screenrecorder.ScreenRecorder (http://www.randelshofer.ch/monte/) class.

These recordings files are saved in the workspace for Jenkins jobs.

Clone this wiki locally