| | 11 | |
| | 12 | === Location of Cron Job Automation file to run Test Framework: === |
| | 13 | |
| | 14 | /etc/cron.custom/testsuite |
| | 15 | |
| | 16 | * What this does currently : |
| | 17 | * Prepares Server |
| | 18 | * Pulls latest codes from web2py/web2py (update web2py) |
| | 19 | * Pulls latest codes from flavour/eden (update Eden) |
| | 20 | * Deletes prepopulated data |
| | 21 | * Loads all models |
| | 22 | * Fixes permissions of the web2py folder |
| | 23 | * Runs Automated Test Suite |
| | 24 | * Runs Smoke Tests |
| | 25 | * Runs Roles Tests |
| | 26 | |
| | 27 | === Edit cron times: === |
| | 28 | (Currently set to run Test Suite every 6 hours every day of every week of every month of every year) |
| | 29 | |
| | 30 | crontab -e |
| | 31 | |
| | 32 | === Location of Web2Py and Eden Directory === |
| | 33 | * web2py |
| | 34 | * /home/web2py |
| | 35 | * Eden |
| | 36 | * /home/web2py/applications/eden |
| | 37 | |
| | 38 | === Overall Restart === |
| | 39 | If 82.71.213.53 goes down with these errors: |
| | 40 | |
| | 41 | * Internal Error |
| | 42 | * Server Maintenance |
| | 43 | * Connection Timeout by every web browser |
| | 44 | * Unresolvable Ticket Error |
| | 45 | |
| | 46 | Simply type these services restart commands in consoles: |
| | 47 | |
| | 48 | * Server Reboot : |
| | 49 | * sudo /sbin/reboot |
| | 50 | * '''Note''' : There will be a downtime of a few minutes after you execute this command |
| | 51 | * Cherokee Restart |
| | 52 | * sudo /etc/init.d/cherokee restart |
| | 53 | * Web2Py SSL Restart |
| | 54 | * sudo /etc/init.d/uwsgi start |
| | 55 | |
| | 56 | === Start Test Suite Manually === |
| | 57 | |
| | 58 | |
| | 59 | xvfb-run -a python web2py.py -S eden -M -R ~web2py/applications/eden/modules/tests/suite.py |
| | 60 | |
| | 61 | |
| | 62 | ==== Shell Script to Start The Test Suite On The CI Server ==== |
| | 63 | |
| | 64 | Simply run this shell script to start Functional selenium test, followed by Smoke test and then finally the Role test. |
| | 65 | You can comment out the lines you don't want to run. |
| | 66 | * Save the Code given below in a file (say, named as startSuite) |
| | 67 | * Add Execution permission to the file |
| | 68 | * chmod +x /location/to/script/startSuite |
| | 69 | * Execute the shell script |
| | 70 | * sudo sh /location/to/script/startSuite |
| | 71 | |
| | 72 | {{{ |
| | 73 | #!div style="font-size: 80%" |
| | 74 | {{{#!sh |
| | 75 | #!/bin/sh |
| | 76 | ######## |
| | 77 | # Cron Script to run Sahana Eden Test Suite |
| | 78 | ######## |
| | 79 | #Server preparation |
| | 80 | sudo /etc/init.d/cherokee restart |
| | 81 | sudo /etc/init.d/uwsgi start |
| | 82 | |
| | 83 | # Pull latest codes from web2py/web2py (update web2py) |
| | 84 | cd /home/web2py |
| | 85 | sudo git stash |
| | 86 | sudo git pull upstream master |
| | 87 | |
| | 88 | # Pull latest codes from flavour/eden (update Eden) |
| | 89 | cd /home/web2py/applications/eden |
| | 90 | sudo git stash |
| | 91 | sudo git pull upstream master |
| | 92 | |
| | 93 | # Delete prepopulated data |
| | 94 | rm -f /home/web2py/applications/eden/databases/* |
| | 95 | |
| | 96 | # Re pre pop db and fix permissions |
| | 97 | cd /home/web2py |
| | 98 | python web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py |
| | 99 | chown -R web2py /home/web2py |
| | 100 | |
| | 101 | # Run Automated Test Suite |
| | 102 | cd /home/web2py |
| | 103 | 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_automated/ -V 2 |
| | 104 | |
| | 105 | # Run Smoke Test (on linkdepth 16) |
| | 106 | cd /home/web2py |
| | 107 | 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 3 |
| | 108 | |
| | 109 | # Run Roles Test |
| | 110 | cd /home/web2py |
| | 111 | xvfb-run -a python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A --suite roles --html-path /home/web2py/applications/eden/static/test_roles/ |
| | 112 | }}} |
| | 113 | }}} |
| | 114 | |
| | 115 | |
| | 116 | |