From 190aff2d8a57884dd80f81e889da6ab1e764fdd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 03:10:29 +0100 Subject: [PATCH 1/8] Fix travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84e3645052d..380a51f36c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,9 +214,9 @@ before_script: #pgloader mysql://root:pass@127.0.0.1/dolibarr_9 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev echo pgloader mysql://root@127.0.0.1/travis postgresql:///travis pgloader mysql://root@127.0.0.1/travis postgresql:///travis - echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | 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 SEQUENCE llx_accountingaccount_rowid_seq RESTART WITH 1000001;' | psql travis + #echo 'select * from information_schema.table_constraints;' | psql travis + #echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis fi # TODO: SQLite echo From 270033469fdd6b1fd188d44db37feefe1259785f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 03:50:05 +0100 Subject: [PATCH 2/8] Log --- test/phpunit/AccountingAccountTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index 1997c96009e..09a7a21d145 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -144,8 +144,9 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $localobject->active = 0; $result=$localobject->create($user); - $this->assertLessThan($result, 0); print __METHOD__." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; } @@ -169,8 +170,9 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $localobject=new AccountingAccount($this->savdb); $result=$localobject->fetch($id); - $this->assertLessThan($result, 0); print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject; } @@ -194,8 +196,9 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $localobject->label='New label'; $result=$localobject->update($user); - $this->assertLessThan($result, 0); print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject->id; } @@ -222,6 +225,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); + return $result; } } From 9c1339ae069f1bebde7a90b467d91bb863c0a1ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 04:27:30 +0100 Subject: [PATCH 3/8] Fix migration with pgsql --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 48a6b191ebf..d72777db230 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -66,6 +66,7 @@ INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32); ALTER TABLE llx_accountingaccount RENAME TO llx_accounting_account; +--VPGSQL8.2 ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq; ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_number (account_number); UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PREFIX_SPEC')__ WHERE __DECRYPT('name')__ = 'EXPORT_PREFIX_SPEC'; From ae1ac001dd97f23de522b05fbf71d83947d7f364 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 04:28:35 +0100 Subject: [PATCH 4/8] Fix travis --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 380a51f36c8..ab95546f577 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,7 +214,9 @@ before_script: #pgloader mysql://root:pass@127.0.0.1/dolibarr_9 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev echo 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 RESTART WITH 1000001;' | 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 'select * from INFORMATION_SCHEMA.COLUMNS where table_name = 'llx_accountingaccount' | psql travis #echo 'select * from information_schema.table_constraints;' | psql travis #echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis fi From 95bfecdd60ebd843d945c2e82786a62a5ce91963 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 05:03:31 +0100 Subject: [PATCH 5/8] Fix missing index in migration --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 0987317b75e..5417f279144 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -29,6 +29,8 @@ -- Missing in 8.0 +ALTER TABLE llx_contrat_extrafields ADD INDEX idx_contrat_extrafields (fk_object); + ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version; ALTER TABLE llx_accounting_account MODIFY COLUMN fk_pcg_version varchar(32) NOT NULL; ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; From 3ca6bf10057b4b811fb2c4384dca590d2bc292fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 05:05:47 +0100 Subject: [PATCH 6/8] Fix sequence name --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab95546f577..56962c3439c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,8 +214,8 @@ before_script: #pgloader mysql://root:pass@127.0.0.1/dolibarr_9 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev echo 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_accounting_account_rowid_seq RESTART WITH 1000001;' | 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 'select * from INFORMATION_SCHEMA.COLUMNS where table_name = 'llx_accountingaccount' | psql travis #echo 'select * from information_schema.table_constraints;' | psql travis #echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis From f8b205aae39876dd1331531538e62d69df735abe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 05:16:23 +0100 Subject: [PATCH 7/8] Fix missing index --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 5417f279144..9b97f7c1918 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -30,6 +30,7 @@ -- Missing in 8.0 ALTER TABLE llx_contrat_extrafields ADD INDEX idx_contrat_extrafields (fk_object); +ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (fk_object); ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version; ALTER TABLE llx_accounting_account MODIFY COLUMN fk_pcg_version varchar(32) NOT NULL; From d4aaaa47e4741c2a48f89f889997cf5ac7911dad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jan 2019 05:50:14 +0100 Subject: [PATCH 8/8] Fix travis --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56962c3439c..fe15c954fc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -319,7 +319,7 @@ script: - | echo "Upgrading Dolibarr" # 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 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 @@ -363,7 +363,7 @@ script: - | echo "Unit testing" # 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 phpunitresult=$? echo "Phpunit return code = $phpunitresult" @@ -371,9 +371,10 @@ script: after_script: - | - echo "After script - Output 50 latest lines of dolibarr.log" + echo "After script - Output lines of dolibarr.log" 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 after_success: - |