Skip to content

Jenkins: running FlexUnit tests on headless Centos 6.7 x64

December 14, 2015

Recently I was asked to configure the FlexUnit test execution upon our Jenkins CI, but all our executors located in the cloud.
Below is a brief summary of the items that need to be installed and setup.

Installation and configuration

Flash

First of all one need flash player on board. To get sources follow Abode downloads page and on that page you need this particular link https://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa.i386.tar.gz. Actually, I didn’t success in debug version installation due t0 some ssl lib compatibility problems.
Once you have downloaded libraries, unpack it:

wget https://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa.i386.tar.gz
tar -xzvf flashplayer_11_sa.i386.tar.gz

Make the symbolic link gflashplayer:

mv flashplayerdebugger /usr/bin/
ln -s /usr/bin/flashplayerdebugger /usr/bin/gflashplayer

Try to execute gflashplayer, if there is any error saying you have some missing dependencies, then run

 ldd flashplayer 

to find out and install all missing 32bit dependencies.

Xvnc

Install xvnc, windowing system and vnc password

yum install vnc-server   
yum groupinstall "GNOME Desktop Environment"   
vncpasswd
Ant/flexUnit

Be sure to set up your FlexUnit task to run in headless mode, to do that you need to configure parameters mentioned below:

  • headless -> true (default: false)

    Setting this attribute to true allows the task to execute tests headlessly via Xvnc.

  • port –> 1024 (default: 1024)

    Setting this attribute informs the task to listen for test results on the specified port. Using this attribute implies that the port on the CIListener instance registered on the FlexUnitCore is registered with the same port number.

  • display –> 99 (default: 99)

    The base display number used by Xvnc for headless support in the task. See below for more details on running headlessly.

Jenkins

It is good practice to kill everything that can bother your ant task execution, the JobDSL chunk below that helps you solve xvnc problems, e.g:

...
shell('killall Xvnc Xrealvnc || true; rm -fv /tmp/.X*-lock /tmp/.X11-unix/X*')
ant{
  targets([])
   buildFile("${WORKSPACE}/project/build_tests.xml")
            antInstallation('Default')
            props(
                    'version': "\$VERSION",
                    'base.source.dir': "\$WORKSPACE/project",
                    'base.build.dir': "\$WORKSPACE/${JOB_NAME}",
                    'flex.sdk.dir': '/opt/flexsdk',
                    'air.sdk.dir': '/opt/airsdk',
                    'tests.headless':true)
}
shell('killall Xvnc Xrealvnc || true;')
...
Useful links:

https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+Ant+Task
https://forums.adobe.com/thread/923741
http://flexceptional.blogspot.ru/2011/04/install-stand-alone-flash-player-on-64.html

Advertisements

From → Jenkins

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: