= Continuous Integration = [[TOC]] == Current Setup == CI Server's cron runs the tests every 6 hours * Using Web2Py from Tue Jan 15 22:23:00 2013 * Using latest Trunk Eden * Using IFRC template * Using SQLite * Using Chrome Results are stored as HTML files in the filesystem which can be accessed via the Eden instance under test: * http://82.71.213.53/RESULTS {{{/usr/local/bin/testsuite}}} * Updates Web2Py to current Trunk (from github.com/web2py/web2py) * Currently disabled * Updates Eden to current Trunk (from github.com/flavour/eden) * Cleans database & prepopulates * Runs Functional Tests (Selenium) * Runs Smoke Tests * Runs Roles Tests * Currently disabled * Mails out test results (using /usr/local/bin/mailTestResults.sh) NB Tests require Python 2.7, so Pythonbrew is used to allow this to coexist with the system Python 2.6 To run the test suite manually: {{{ /usr/local/bin/web2pystarter }}} Open another console then: {{{ /usr/local/bin/testsuite }}} To just run smoke tests: {{{ cd /home/web2py xvfb-run -a python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A --html-path /home/web2py/applications/eden/static/test_smoke/ --suite smoke --force-debug --link-depth 16 -V 4 }}} Start Window based applications (x11): * If the GUI window of the application is of no interest to you: {{{#!sh xvfb-run -a *test commands here* }}} For example : {{{#!sh xvfb-run -a python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A -V 2 }}} '''Note''': Xvfb basically makes a virtual display which isn't displayed anywhere. Xserver itself actually requires a real display * If you want to see the GUI interface of the application * If the machine you use to ssh into the server, has X Server installed, then you can access the GUI window by using the -X flag when loggin into the server {{{#!sh ssh -X youraccount@82.71.213.53 }}} And now, if you simply execute any application which has a Xserver attached to it, it will be displayed on your screen. == Setup for Load tests == Installed the following to do load testing using the CI Server - * erlang - Version : R16B01 * tsung-1.4.2 For report generation - * zlib-1.2.8 * libpng-1.2.8 * freetype-2.4.0 * gd-2.0.33 * gnuplot-4.0.0 The installation script for installing these is here - {{{ #!/bin/sh # Download erlang source wget http://erlang.org/download/otp_src_R16B01.tar.gz tar xzf otp_src_R16B01.tar.gz cd otp_src_R16B01 # Install erlang ./configure -prefix=/opt/erlang-R16B01 make # Add /opt/erlang-R16B01/bin to path # in /etc/profile, add echo "export PATH=$PATH:/opt/erlang-R16B01/bin" >> /etc/profile . /etc/profile cd .. # Download tsung. wget http://tsung.erlang-projects.org/dist/tsung-1.4.2.tar.gz tar zxf tsung-1.4.2.tar.gz cd tsung-1.4.2 # Install tsung ./configure --prefix=/opt/tsung-1.4.2 sudo make install # Add /opt/tsung-1.4.2/bin to path # in /etc/profile, add echo "export PATH=$PATH:/opt/tsung-1.4.2/bin" >> /etc/profile . /etc/profile sudo cpan Template cd .. # install zlib wget zlib.net/zlib-1.2.8.tar.gz tar xzf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure --prefix=/opt/zlib-1.2.8 make test sudo make install cd .. # install libpng wget download.sourceforge.net/libpng/libpng-1.2.8.tar.gz tar xzf libpng-1.2.8.tar.gz cd libpng-1.2.8/ cp scripts/makefile.linux makefile make make test sudo make install cd .. # install freetype wget download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.gz tar xzf freetype-2.4.0.tar.gz cd freetype-2.4.0 ./configure --prefix=/opt/freetype-2.4.0 make sudo make install cd .. # install gd for png support of gnuplot. wget www12.tucows.com/linux/files/gd-2.0.33.tar.gz tar xzf gd-2.0.33 cd gd-2.0.33 ./configure --prefix=/opt/gd-2.0.33 sudo make install cd .. # Install gnuplot wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.6.3/gnuplot-4.0.0.tar.gz tar xzf gnuplot-4.0.0.tar.gz cd gnuplot-4.0.0 ./configure --prefix=/opt/gnuplot-4.4.0 sudo make install # Add /opt/gnuplot-4.4.0/bin to path # in /etc/profile, add echo "export PATH=$PATH:/opt/tsung-1.4.2/bin" >> /etc/profile . /etc/profile }}} == Plans for Future == * ~~Move mailing script out of a personal user directory~~ * ~~Move cron commands to system /etc/crontab rather than root's crontab~~ * Fix Reporting of Smoke Tests * Enable Roles Tests & fix any issues which caused it to be disabled * Run Unit Tests * More templates (default, etc) * More databases * More browsers * More web2py versions * e.g. 'Current Stable' (as-defined by Eden) & 'Trunk' * having errors in Trunk Web2pY which aren't seen in 'Current Stable' homes us in on where problems lie * Install an Eden instance to act as a CI server * Move the cron scripts to being run by Eden Scheduler * Have Eden manage the mailing of results & manage subscriptions * Have Eden store the results in the database for Graphical analysis * Same Eden instance can be Sunflower which replaces Trac for tickets * Have Eden analyse results intelligently - e.g. logging tickets for Web2Py issues when web2py version is seen as the cause * AUT should be possible on remote servers * e.g. Spawn AWS instances using https://github.com/flavour/spawn-eden * AMIs built for Cherokee/PostgreSQL & Apache/MySQL to speed-up bootstrapping of instances * Can do Performance Testing * Can do Tests on servers with User Data? * This replaces the old install of [SysAdmin/Jenkins Jenkins] Setup Notes & Discussions (to be ported to Wiki): * https://docs.google.com/document/d/1T29cF3kkK4lIAVdiATfE8a-tLm_Tyh3_dIh6FJWY7sU/edit