Skip to content

Loading…

Travis ci support #120

Open
wants to merge 21 commits into from

4 participants

@BjoernSchotte

Added support for travis-ci test runs. It isn't finished yet:

  • unfortunately phpunit doesn't seem to run the tests?
  • README.md should follow with integrated travis-ci icon

Can you please point me into the right direction? Would love to see travis-ci support for SugarCRM CE.

@jmertic

Sure, would be glad to help you out. Let me know what questions I can answer for you.

@BjoernSchotte

Have a look at http://travis-ci.org/#!/BjoernSchotte/sugarcrm_dev/jobs/2462568 - at the end phpunit produces no output. I'm not sure which command I need to successfully run the unit tests from console. I also tried "script: phpunit -c phpuc.xml", but there was empty output.

@jmertic
@jmertic
@alias-mac
SugarCRM member
@jmertic
@alias-mac
SugarCRM member
@jmertic
@bountin

Are there any plans to release Sugar's testing framework as a separate package? We have many customizations and would be very happy if we could have unit tests for them. Otherwise I would create such a package manually by isolating the necessary parts of the tests directory but I'd be glad if I could spend my time with other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 107 additions and 0 deletions.
  1. +20 −0 .travis.yml
  2. +32 −0 .travis/config_si.php
  3. +22 −0 .travis/travis-ci-phpenv-sugarcrmce.txt
  4. +33 −0 .travis/travis-ci-vhost-sugarcrmce.txt
View
20 .travis.yml
@@ -0,0 +1,20 @@
+language: php
+php:
+ - "5.4"
+ - "5.3"
+
+before_script:
+ - cp .travis/config_si.php `pwd`
+ - sudo apt-get install apache2 libapache2-mod-php5
+ - sudo a2enmod actions
+ - sudo a2enmod rewrite
+ - echo "export PATH=/home/vagrant/.phpenv/bin:$PATH" | sudo tee -a /etc/apache2/envvars > /dev/null
+ - cat .travis/travis-ci-phpenv-sugarcrmce.txt | sudo tee /etc/apache2/conf.d/phpconfig > /dev/null
+ - cat .travis/travis-ci-vhost-sugarcrmce.txt | sed -e "s,PATH,`pwd`,g" | sudo tee /etc/apache2/sites-available/default > /dev/null
+ - sudo service apache2 restart
+ - mysql -u root -e "CREATE USER 'sugarcrm'@'localhost' IDENTIFIED BY 'sugarcrm'"
+ - mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'sugarcrm'@'localhost' WITH GRANT OPTION;"
+ - curl 'http://localhost/install.php?goto=SilentInstall&cli=true'
+ - cd tests
+
+script: ./phpunit.php --verbose SugarTestHelper
View
32 .travis/config_si.php
@@ -0,0 +1,32 @@
+<?php
+# config_si for travis build
+#
+$sugar_config_si = array (
+ 'setup_db_host_name' => 'localhost',
+ 'setup_db_database_name' => 'sugarcrm',
+ 'setup_db_drop_tables' => 0,
+ 'setup_db_create_database' => 1,
+ 'setup_db_pop_demo_data' => 'yes',
+ 'setup_site_admin_user_name'=>'admin',
+ 'setup_site_admin_password' => 'admin',
+ 'setup_db_create_sugarsales_user' => 1,
+ 'setup_db_admin_user_name' => 'sugarcrm',
+ 'setup_db_admin_password' => 'sugarcrm',
+ 'setup_db_sugarsales_user' => 'root',
+ 'setup_db_sugarsales_password' => 'root',
+ 'setup_db_type' => 'mysql',
+ 'setup_site_url' => 'http://localhost/',
+ # 'setup_system_name' => '${systemname}',
+ 'default_currency_iso4217' => 'USD',
+ 'default_currency_name' => 'US Dollars',
+ 'default_currency_significant_digits' => '2',
+ 'default_currency_symbol' => '$',
+ 'default_date_format' => 'Y-m-d',
+ 'default_time_format' => 'H:i',
+ 'default_decimal_seperator' => '.',
+ 'default_export_charset' => 'ISO-8859-1',
+ 'default_language' => 'en_us',
+ 'default_locale_name_format' => 's f l',
+ 'default_number_grouping_seperator' => ',',
+ 'export_delimiter' => ',',
+);
View
22 .travis/travis-ci-phpenv-sugarcrmce.txt
@@ -0,0 +1,22 @@
+# PHPENV Setup
+<IfModule alias_module>
+ ScriptAlias /phpenv "/home/vagrant/.phpenv/shims"
+ <Directory "/home/vagrant/.phpenv/shims">
+ Order allow,deny
+ Allow from all
+ </Directory>
+</IfModule>
+
+<IfModule mime_module>
+ AddType application/x-httpd-php5 .php
+</IfModule>
+
+<IfModule dir_module>
+ DirectoryIndex index.php index.html
+</IfModule>
+
+Action application/x-httpd-php5 "/phpenv/php-cgi"
+
+RewriteEngine On
+RewriteLog "/tmp/rewrite.log"
+RewriteLogLevel 9
View
33 .travis/travis-ci-vhost-sugarcrmce.txt
@@ -0,0 +1,33 @@
+<VirtualHost *:80>
+ ServerAdmin webmaster@localhost
+
+ DocumentRoot PATH
+ <Directory />
+ Options FollowSymLinks
+ AllowOverride All
+ </Directory>
+ <Directory PATH >
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride All
+ Order allow,deny
+ allow from all
+ </Directory>
+
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+ <Directory "/usr/lib/cgi-bin">
+ AllowOverride All
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ php_value error_reporting "E_ALL ^ E_STRICT"
+ ErrorLog ${APACHE_LOG_DIR}/error.log
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel warn
+
+ CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+</VirtualHost>
Something went wrong with that request. Please try again.