travis setup
Co-authored-by: Yamuna Adhikari <adhikariamuna4444@gmail.com>
This commit is contained in:
parent
1ef46d082c
commit
f343fbb55e
559
.travis.yml
559
.travis.yml
@ -8,48 +8,63 @@ dist: xenial
|
|||||||
#dist: bionic
|
#dist: bionic
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
language: php
|
matrix:
|
||||||
|
include:
|
||||||
|
- language: php
|
||||||
|
php:
|
||||||
|
- '5.6'
|
||||||
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
|
- '7.2'
|
||||||
|
- '7.3'
|
||||||
|
- '7.4'
|
||||||
|
- nightly
|
||||||
|
|
||||||
|
- language: node_js
|
||||||
|
node_js:
|
||||||
|
- '12.14.0'
|
||||||
|
before_install:
|
||||||
|
- docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm --name selenium selenium/standalone-chrome-debug
|
||||||
|
install:
|
||||||
|
- npm install
|
||||||
|
script: yarn test:e2e test/acceptance/features
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- LAUNCH_URL=http://127.0.0.1/$TRAVIS_BUILD_DIR/htdocs
|
||||||
|
|
||||||
# Start on every boot
|
# Start on every boot
|
||||||
services:
|
services:
|
||||||
- memcached
|
- memcached
|
||||||
- mysql
|
- mysql
|
||||||
- postgresql
|
- postgresql
|
||||||
|
- docker
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
# Force postgresql to 9.4 (the oldest availablable on xenial)
|
# Force postgresql to 9.4 (the oldest availablable on xenial)
|
||||||
postgresql: '9.4'
|
postgresql: '9.4'
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
# To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/
|
# To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/
|
||||||
- pgdg-xenial
|
- pgdg-xenial
|
||||||
packages:
|
packages:
|
||||||
# We need a webserver to test the webservices
|
# We need a webserver to test the webservices
|
||||||
# Let's install Apache with.
|
# Let's install Apache with.
|
||||||
- apache2
|
- apache2
|
||||||
# mod_php is not supported by Travis. Add fcgi. We install FPM later on.
|
# mod_php is not supported by Travis. Add fcgi. We install FPM later on.
|
||||||
- libapache2-mod-fastcgi
|
- libapache2-mod-fastcgi
|
||||||
# We need pgloader for import mysql database into pgsql
|
# We need pgloader for import mysql database into pgsql
|
||||||
- pgloader
|
- pgloader
|
||||||
|
|
||||||
php:
|
|
||||||
- '5.6'
|
|
||||||
- '7.0'
|
|
||||||
- '7.1'
|
|
||||||
- '7.2'
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- nightly
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# Set to true for very verbose output
|
# Set to true for very verbose output
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
jobs:
|
jobs:
|
||||||
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
||||||
#- DB=mariadb
|
#- DB=mariadb
|
||||||
- DB=mysql
|
- DB=mysql
|
||||||
- DB=postgresql
|
- DB=postgresql
|
||||||
# See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
|
# See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
|
||||||
#- WS=apache
|
#- WS=apache
|
||||||
# See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
|
# See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
|
||||||
@ -58,27 +73,27 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: nightly
|
- php: nightly
|
||||||
# We exclude some combinations not usefull to save Travis CPU
|
# We exclude some combinations not usefull to save Travis CPU
|
||||||
exclude:
|
exclude:
|
||||||
- php: '7.0'
|
- php: '7.0'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.1'
|
- php: '7.1'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.2'
|
- php: '7.2'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.3'
|
- php: '7.3'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.0'
|
- php: '7.0'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- php: '7.1'
|
- php: '7.1'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- php: '7.2'
|
- php: '7.2'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- php: '7.3'
|
- php: '7.3'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- php: nightly
|
- php: nightly
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
@ -86,59 +101,59 @@ notifications:
|
|||||||
on_failure: never # [always|never|change] default: always
|
on_failure: never # [always|never|change] default: always
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
- "chat.freenode.net#dolibarr"
|
- "chat.freenode.net#dolibarr"
|
||||||
on_success: change
|
on_success: change
|
||||||
on_failure: always
|
on_failure: always
|
||||||
use_notice: true
|
use_notice: true
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- |
|
- |
|
||||||
echo "Disabling Xdebug for composer"
|
echo "Disabling Xdebug for composer"
|
||||||
export PHP_VERSION_NAME=$(phpenv version-name)
|
export PHP_VERSION_NAME=$(phpenv version-name)
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
||||||
phpenv config-rm xdebug.ini
|
phpenv config-rm xdebug.ini
|
||||||
echo
|
|
||||||
|
|
||||||
- |
|
|
||||||
if [ "$DB" = 'postgresql' ]; then
|
|
||||||
echo "Check pgloader version"
|
|
||||||
pgloader --version
|
|
||||||
echo
|
echo
|
||||||
fi
|
|
||||||
|
- |
|
||||||
|
if [ "$DB" = 'postgresql' ]; then
|
||||||
|
echo "Check pgloader version"
|
||||||
|
pgloader --version
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
echo "Updating Composer"
|
echo "Updating Composer"
|
||||||
rm $TRAVIS_BUILD_DIR/composer.json
|
rm $TRAVIS_BUILD_DIR/composer.json
|
||||||
rm $TRAVIS_BUILD_DIR/composer.lock
|
rm $TRAVIS_BUILD_DIR/composer.lock
|
||||||
composer self-update
|
composer self-update
|
||||||
# To have composer making parallel downloads
|
# To have composer making parallel downloads
|
||||||
composer global require hirak/prestissimo
|
composer global require hirak/prestissimo
|
||||||
composer -n init
|
composer -n init
|
||||||
composer -n config vendor-dir htdocs/includes
|
composer -n config vendor-dir htdocs/includes
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \
|
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \
|
||||||
[ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
[ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||||
composer -n require phpunit/phpunit ^5 \
|
composer -n require phpunit/phpunit ^5 \
|
||||||
php-parallel-lint/php-parallel-lint ^0 \
|
php-parallel-lint/php-parallel-lint ^0 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
|
||||||
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
|
||||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \
|
|
||||||
php-parallel-lint/php-parallel-lint ^1 \
|
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
|
||||||
squizlabs/php_codesniffer ^3
|
|
||||||
fi
|
fi
|
||||||
echo
|
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
|
composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \
|
||||||
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
|
squizlabs/php_codesniffer ^3
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Adding path of binaries tools installed by composer to the PATH"
|
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -261,201 +276,201 @@ before_script:
|
|||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
echo "Checking webserver availability by a wget -O - http://127.0.0.1"
|
echo "Checking webserver availability by a wget -O - http://127.0.0.1"
|
||||||
# Ensure we stop on error with set -e
|
# Ensure we stop on error with set -e
|
||||||
set +e
|
set +e
|
||||||
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
|
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
|
||||||
wget -O - http://127.0.0.1 > test.html
|
wget -O - http://127.0.0.1 > test.html
|
||||||
head test.html
|
head test.html
|
||||||
sudo cat /var/log/apache2/travis_error_log
|
sudo cat /var/log/apache2/travis_error_log
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Checking PHP syntax errors"
|
echo "Checking PHP syntax errors"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
#parallel-lint --exclude htdocs/includes --blame .
|
#parallel-lint --exclude htdocs/includes --blame .
|
||||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Checking coding style (excluding Pull Requests builds)"
|
echo "Checking coding style (excluding Pull Requests builds)"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# Exclusions are defined in the ruleset.xml file
|
||||||
#phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
#phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
||||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
export INSTALL_FORCED_FILE=htdocs/install/install.forced.php
|
export INSTALL_FORCED_FILE=htdocs/install/install.forced.php
|
||||||
echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation"
|
echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set +e
|
set +e
|
||||||
echo '<?php ' > $INSTALL_FORCED_FILE
|
echo '<?php ' > $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE
|
||||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
||||||
echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE
|
||||||
fi
|
fi
|
||||||
if [ "$DB" = 'postgresql' ]; then
|
if [ "$DB" = 'postgresql' ]; then
|
||||||
echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE
|
||||||
fi
|
fi
|
||||||
echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_databaselogin=\'travis\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_databaselogin=\'travis\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_databasepass=\'\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_databasepass=\'\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
|
||||||
echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE
|
echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE
|
||||||
#cat $INSTALL_FORCED_FILE
|
#cat $INSTALL_FORCED_FILE
|
||||||
|
|
||||||
#- |
|
#- |
|
||||||
# echo "Installing Dolibarr"
|
# echo "Installing Dolibarr"
|
||||||
# cd htdocs/install
|
# cd htdocs/install
|
||||||
# php step1.php $TRAVIS_BUILD_DIR/htdocs > $TRAVIS_BUILD_DIR/install.log
|
# php step1.php $TRAVIS_BUILD_DIR/htdocs > $TRAVIS_BUILD_DIR/install.log
|
||||||
# php step2.php set >> $TRAVIS_BUILD_DIR/install.log
|
# php step2.php set >> $TRAVIS_BUILD_DIR/install.log
|
||||||
# if [ "$?" -ne "0" ]; then
|
# if [ "$?" -ne "0" ]; then
|
||||||
# echo "SORRY, AN ERROR OCCURED DURING INSTALLATION PROCESS"
|
# echo "SORRY, AN ERROR OCCURED DURING INSTALLATION PROCESS"
|
||||||
# cat $TRAVIS_BUILD_DIR/install.log
|
# cat $TRAVIS_BUILD_DIR/install.log
|
||||||
# exit 1
|
# exit 1
|
||||||
# fi
|
# fi
|
||||||
# cd ../..
|
# cd ../..
|
||||||
# rm $INSTALL_FORCED_FILE
|
# rm $INSTALL_FORCED_FILE
|
||||||
# #cat $TRAVIS_BUILD_DIR/install.log
|
# #cat $TRAVIS_BUILD_DIR/install.log
|
||||||
# set +e
|
# set +e
|
||||||
# echo
|
# echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Setting up database to test migrations"
|
echo "Setting up database to test migrations"
|
||||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
||||||
echo "MySQL"
|
echo "MySQL"
|
||||||
mysql -e 'DROP DATABASE IF EXISTS travis;'
|
mysql -e 'DROP DATABASE IF EXISTS travis;'
|
||||||
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
||||||
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||||
mysql -e 'FLUSH PRIVILEGES;'
|
mysql -e 'FLUSH PRIVILEGES;'
|
||||||
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||||
fi
|
fi
|
||||||
if [ "$DB" = 'postgresql' ]; then
|
if [ "$DB" = 'postgresql' ]; then
|
||||||
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||||
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
|
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
|
||||||
echo pgloader mysql://root@127.0.0.1/travis postgresql:///travis
|
echo pgloader mysql://root@127.0.0.1/travis postgresql:///travis
|
||||||
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
|
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
|
||||||
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql travis
|
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql travis
|
||||||
echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql travis
|
echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql travis
|
||||||
#echo 'select * from INFORMATION_SCHEMA.COLUMNS where table_name = 'llx_accountingaccount' | psql travis
|
#echo 'select * from INFORMATION_SCHEMA.COLUMNS where table_name = 'llx_accountingaccount' | psql travis
|
||||||
#echo 'select * from information_schema.table_constraints;' | psql travis
|
#echo 'select * from information_schema.table_constraints;' | psql travis
|
||||||
#echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis
|
#echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Upgrading Dolibarr"
|
echo "Upgrading Dolibarr"
|
||||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
|
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
|
||||||
set +e
|
set +e
|
||||||
cd htdocs/install
|
cd htdocs/install
|
||||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
|
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
|
||||||
php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log
|
php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log
|
||||||
php step5.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-3.log
|
php step5.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-3.log
|
||||||
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
|
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
|
||||||
php upgrade2.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-2.log
|
php upgrade2.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-2.log
|
||||||
php step5.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-3.log
|
php step5.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-3.log
|
||||||
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
|
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
|
||||||
php upgrade2.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-2.log
|
php upgrade2.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-2.log
|
||||||
php step5.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-3.log
|
php step5.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-3.log
|
||||||
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
|
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
|
||||||
php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log
|
php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log
|
||||||
php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log
|
php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log
|
||||||
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
|
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
|
||||||
php upgrade2.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
php upgrade2.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
||||||
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
||||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
||||||
php upgrade2.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
php upgrade2.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||||
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
||||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||||
php upgrade2.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
php upgrade2.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||||
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
|
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
|
||||||
php upgrade2.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
php upgrade2.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||||
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
|
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
|
||||||
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
|
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
|
||||||
php upgrade2.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-2.log
|
php upgrade2.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-2.log
|
||||||
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
|
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
|
||||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
||||||
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
||||||
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
||||||
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
|
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
|
||||||
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
|
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
|
||||||
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
|
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
|
||||||
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade10001100.log
|
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade10001100.log
|
||||||
php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade10001100-2.log
|
php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade10001100-2.log
|
||||||
php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade10001100-3.log
|
php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade10001100-3.log
|
||||||
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log
|
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log
|
||||||
php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log
|
php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log
|
||||||
php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log
|
php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log
|
||||||
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
||||||
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
||||||
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
||||||
|
|
||||||
# Enable modules not enabled into original dump
|
# Enable modules not enabled into original dump
|
||||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
|
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
echo $?
|
echo $?
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
#cat /tmp/dolibarr_install.log
|
#cat /tmp/dolibarr_install.log
|
||||||
cat $TRAVIS_BUILD_DIR/enablemodule.log
|
cat $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Unit testing"
|
echo "Unit testing"
|
||||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
|
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
|
||||||
set -e
|
set -e
|
||||||
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
||||||
phpunitresult=$?
|
phpunitresult=$?
|
||||||
echo "Phpunit return code = $phpunitresult"
|
echo "Phpunit return code = $phpunitresult"
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- |
|
- |
|
||||||
echo "After script - Output lines of dolibarr.log"
|
echo "After script - Output lines of dolibarr.log"
|
||||||
ls $TRAVIS_BUILD_DIR/documents
|
ls $TRAVIS_BUILD_DIR/documents
|
||||||
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
echo Success
|
echo Success
|
||||||
|
|
||||||
after_failure:
|
after_failure:
|
||||||
- |
|
- |
|
||||||
echo Failure detected, so we show samples of log to help diagnose
|
echo Failure detected, so we show samples of log to help diagnose
|
||||||
# This part of code is executed only if previous command that fails are enclosed with set +e
|
# This part of code is executed only if previous command that fails are enclosed with set +e
|
||||||
# Upgrade log files
|
# Upgrade log files
|
||||||
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
||||||
do
|
do
|
||||||
echo "Debugging informations for file $ficlog"
|
echo "Debugging informations for file $ficlog"
|
||||||
#cat $ficlog
|
#cat $ficlog
|
||||||
done
|
done
|
||||||
# Apache log file
|
# Apache log file
|
||||||
echo "Debugging informations for file apache error.log"
|
echo "Debugging informations for file apache error.log"
|
||||||
sudo cat /var/log/apache2/travis_error_log
|
sudo cat /var/log/apache2/travis_error_log
|
||||||
if [ "$DEBUG" = true ]; then
|
if [ "$DEBUG" = true ]; then
|
||||||
# Dolibarr log file
|
# Dolibarr log file
|
||||||
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
||||||
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
# Database log file
|
# Database log file
|
||||||
echo "Debugging informations for file mysql error.log"
|
echo "Debugging informations for file mysql error.log"
|
||||||
sudo tail -n 50 /var/log/mysql/error.log
|
sudo tail -n 50 /var/log/mysql/error.log
|
||||||
# TODO: PostgreSQL log file
|
# TODO: PostgreSQL log file
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
const admin_username = process.env.ADMIN_USERNAME || 'dolibarr';
|
const admin_username = process.env.ADMIN_USERNAME || 'dolibarr';
|
||||||
const admin_password = process.env.ADMIN_PASSWORD || 'password';
|
const admin_password = process.env.ADMIN_PASSWORD || 'password';
|
||||||
const launch_url = process.env.LAUNCH_URL || 'http://localhost/dolibarr/htdocs/';
|
const launch_url = process.env.LAUNCH_URL || 'http://localhost/dolibarr/htdocs/';
|
||||||
const dol_api_key = process.env.DOLAPIKEY || 'superadminuser';
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
page_objects_path : './test/acceptance/pageObjects/', // jshint ignore:line
|
page_objects_path : './test/acceptance/pageObjects/', // jshint ignore:line
|
||||||
src_folders : ['test'],
|
src_folders : ['test'],
|
||||||
@ -13,8 +12,7 @@ module.exports = {
|
|||||||
globals : {
|
globals : {
|
||||||
backend_url : launch_url,
|
backend_url : launch_url,
|
||||||
adminUsername : admin_username,
|
adminUsername : admin_username,
|
||||||
adminPassword : admin_password,
|
adminPassword : admin_password
|
||||||
dolApiKey : dol_api_key
|
|
||||||
},
|
},
|
||||||
desiredCapabilities : {
|
desiredCapabilities : {
|
||||||
browserName : 'chrome',
|
browserName : 'chrome',
|
||||||
|
|||||||
@ -5,9 +5,10 @@
|
|||||||
"nightwatch-api": "^3.0.1"
|
"nightwatch-api": "^3.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:e2e": "node_modules/cucumber/bin/cucumber-js --require test/acceptance/index.js --require test/acceptance/stepDefinitions"
|
"test:e2e": "node_modules/cucumber/bin/cucumber-js --require test/acceptance/index.js --require test/acceptance/stepDefinitions -f node_modules/cucumber-pretty"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"cucumber-pretty": "^6.0.0",
|
||||||
"node-fetch": "^2.6.1"
|
"node-fetch": "^2.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const { Before, Given, When, Then, After } = require('cucumber');
|
|||||||
const { client } = require('nightwatch-api');
|
const { client } = require('nightwatch-api');
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
let initialUsers = {};
|
let initialUsers = {};
|
||||||
|
let dolApiKey = '';
|
||||||
|
|
||||||
Given('the administrator has logged in using the webUI', async function () {
|
Given('the administrator has logged in using the webUI', async function () {
|
||||||
await client.page.loginPage().navigate().waitForLoginPage();
|
await client.page.loginPage().navigate().waitForLoginPage();
|
||||||
@ -46,7 +47,7 @@ const getUsers = async function () {
|
|||||||
const url = client.globals.backend_url + 'api/index.php/users';
|
const url = client.globals.backend_url + 'api/index.php/users';
|
||||||
const users = {};
|
const users = {};
|
||||||
header['Accept'] = 'application/json';
|
header['Accept'] = 'application/json';
|
||||||
header['DOLAPIKEY'] = client.globals.dolApiKey;
|
header['DOLAPIKEY'] = dolApiKey;
|
||||||
await fetch(url, {
|
await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: header
|
headers: header
|
||||||
@ -64,7 +65,7 @@ const adminHasCreatedUser = async function (dataTable) {
|
|||||||
const header = {};
|
const header = {};
|
||||||
const url = client.globals.backend_url + 'api/index.php/users';
|
const url = client.globals.backend_url + 'api/index.php/users';
|
||||||
header['Accept'] = 'application/json';
|
header['Accept'] = 'application/json';
|
||||||
header['DOLAPIKEY'] = client.globals.dolApiKey;
|
header['DOLAPIKEY'] = dolApiKey;
|
||||||
header['Content-Type'] = 'application/json';
|
header['Content-Type'] = 'application/json';
|
||||||
const userDetails = dataTable.hashes();
|
const userDetails = dataTable.hashes();
|
||||||
for (const user of userDetails) {
|
for (const user of userDetails) {
|
||||||
@ -89,6 +90,24 @@ const adminHasCreatedUser = async function (dataTable) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Before(async () => {
|
||||||
|
const header = {}
|
||||||
|
const adminUsername = client.globals.adminUsername;
|
||||||
|
const adminPassword = client.globals.adminPassword;
|
||||||
|
const params = new URLSearchParams()
|
||||||
|
params.set('login', adminUsername)
|
||||||
|
params.set('password', adminPassword)
|
||||||
|
const apiKey = `http://localhost/dolibarr/htdocs/api/index.php/login?${params.toString()}`;
|
||||||
|
header['Accept'] = 'application/json'
|
||||||
|
await fetch(apiKey, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: header
|
||||||
|
})
|
||||||
|
.then(async (response) => {
|
||||||
|
const jsonResponse = await response.json()
|
||||||
|
dolApiKey = jsonResponse['success']['token']
|
||||||
|
})
|
||||||
|
})
|
||||||
Before(async () => {
|
Before(async () => {
|
||||||
initialUsers = await getUsers();
|
initialUsers = await getUsers();
|
||||||
});
|
});
|
||||||
@ -98,7 +117,7 @@ After(async () => {
|
|||||||
const header = {};
|
const header = {};
|
||||||
const url = client.globals.backend_url + 'api/index.php/users/';
|
const url = client.globals.backend_url + 'api/index.php/users/';
|
||||||
header['Accept'] = 'application/json';
|
header['Accept'] = 'application/json';
|
||||||
header['DOLAPIKEY'] = client.globals.dolApiKey;
|
header['DOLAPIKEY'] = dolApiKey;
|
||||||
let found;
|
let found;
|
||||||
for (const finaluser in finalUsers) {
|
for (const finaluser in finalUsers) {
|
||||||
for (const initialuser in initialUsers) {
|
for (const initialuser in initialUsers) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user