Skip to content
Snippets Groups Projects
Commit 2dec2d7c authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev_178030 wip : fix memory leak on php7.4 : trace memory

dev_178030 wip : fix memory leak on php7.4 : split testSuites

dev_178030 wip : fix memory leak on php7.4 : split testSuites

dev_178030 wip : fix memory leak on php7.4 : split testSuites

This reverts commit 5599ca44.
parent dfad68d0
No related merge requests found
Pipeline #25169 passed with stage
in 17 minutes and 57 seconds
......@@ -33,6 +33,20 @@ test:php74_other:
- bladerunner
test:php74_scenario:
image: bokeh_php74_with_chrome
services:
- localhost:5000/bokeh_mariadb_10.3
- sthysel/nuhtml
script:
- bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD
- bash build_scenario.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST
except:
- tags
tags:
- bladerunner
test:php81_bokeh:
image: bokeh_php81
services:
......@@ -59,3 +73,17 @@ test:php81_other:
- tags
tags:
- bladerunner
test:php81_scenario:
image: bokeh_php81
services:
- localhost:5000/bokeh_mariadb_10.3
- sthysel/nuhtml
script:
- bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD
- bash build_scenario.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST
except:
- tags
tags:
- bladerunner
\ No newline at end of file
......@@ -4,30 +4,9 @@ DBUSER=$2
DBPASS=$3
DBHOST=$4
source ./update.sh
cp config.ini.default config.ini
sed -i "s/sgbd.config.host = localhost/sgbd.config.host = $DBHOST/g" config.ini
sed -i "s/sgbd.config.username =/sgbd.config.username = $DBUSER/g" config.ini
sed -i "s/sgbd.config.password =/sgbd.config.password = $DBPASS/g" config.ini
sed -i "s/sgbd.config.dbname =/sgbd.config.dbname = $DBNAME/g" config.ini
touch local.php
php --version
php -d display_errors=on -d error_reporting=E_ALL scripts/upgrade_db.php
cd cosmogramme
cp config.ref.php config.php
sed -i "s/integration_server=localhost/integration_server=$DBHOST/g" config.php
sed -i "s/integration_user=root/integration_user=$DBUSER/g" config.php
sed -i "s/integration_pwd=root/integration_pwd=$DBPASS/g" config.php
sed -i "s/integration_base=opac3/integration_base=$DBNAME/g" config.php
cd ..
export OPENSSL_CONF=/etc/ssl/
source ./build_bokeh_config.sh $DBNAME $DBUSER $DBPASS $DBHOST
EARLY_DESC=`php -r "echo version_compare(PHP_VERSION, '8.1', '>=') ? '--fail-error-with-desc' : '';"`
phpunit -c tests/phpunit_eco.xml --list-suites && phpunit -c tests/phpunit_eco.xml \
&& phpunit -c tests/phpunit.xml --list-suites $EARLY_DESC \
phpunit -c tests/phpunit.xml --list-suites $EARLY_DESC \
&& phpunit -c tests/phpunit.xml --exclude-group no-ci $EARLY_DESC
#!/bin/bash
DBNAME=$1
DBUSER=$2
DBPASS=$3
DBHOST=$4
source ./update.sh
cp config.ini.default config.ini
sed -i "s/sgbd.config.host = localhost/sgbd.config.host = $DBHOST/g" config.ini
sed -i "s/sgbd.config.username =/sgbd.config.username = $DBUSER/g" config.ini
sed -i "s/sgbd.config.password =/sgbd.config.password = $DBPASS/g" config.ini
sed -i "s/sgbd.config.dbname =/sgbd.config.dbname = $DBNAME/g" config.ini
touch local.php
php --version
php -d display_errors=on -d error_reporting=E_ALL scripts/upgrade_db.php
cd cosmogramme
cp config.ref.php config.php
sed -i "s/integration_server=localhost/integration_server=$DBHOST/g" config.php
sed -i "s/integration_user=root/integration_user=$DBUSER/g" config.php
sed -i "s/integration_pwd=root/integration_pwd=$DBPASS/g" config.php
sed -i "s/integration_base=opac3/integration_base=$DBNAME/g" config.php
cd ..
export OPENSSL_CONF=/etc/ssl/
function earlyDesc() {
`php -r "echo version_compare(PHP_VERSION, '8.1', '>=') ? '--fail-error-with-desc' : '';"`
}
......@@ -4,29 +4,19 @@ DBUSER=$2
DBPASS=$3
DBHOST=$4
source ./update.sh
cp config.ini.default config.ini
sed -i "s/sgbd.config.host = localhost/sgbd.config.host = $DBHOST/g" config.ini
sed -i "s/sgbd.config.username =/sgbd.config.username = $DBUSER/g" config.ini
sed -i "s/sgbd.config.password =/sgbd.config.password = $DBPASS/g" config.ini
sed -i "s/sgbd.config.dbname =/sgbd.config.dbname = $DBNAME/g" config.ini
touch local.php
source ./build_bokeh_config.sh $DBNAME $DBUSER $DBPASS $DBHOST
php --version
EARLY_DESC=`php -r "echo version_compare(PHP_VERSION, '8.1', '>=') ? '--fail-error-with-desc' : '';"`
php -d display_errors=on -d error_reporting=E_ALL scripts/upgrade_db.php
cd cosmogramme
cp config.ref.php config.php
sed -i "s/integration_server=localhost/integration_server=$DBHOST/g" config.php
sed -i "s/integration_user=root/integration_user=$DBUSER/g" config.php
sed -i "s/integration_pwd=root/integration_pwd=$DBPASS/g" config.php
sed -i "s/integration_base=opac3/integration_base=$DBNAME/g" config.php
cd ..
export OPENSSL_CONF=/etc/ssl/
phpunit -c tests/phpunit_db.xml --list-suites && phpunit -c tests/phpunit_db.xml --exclude-group no-ci \
&& phpunit -c tests/phpunit_js.xml --list-suites && phpunit -c tests/phpunit_js.xml --exclude-group no-ci \
&& cd cosmogramme/tests && phpunit --list-suites && phpunit --exclude-group no-ci \
&& cd ../cosmozend/tests && phpunit --list-suites && phpunit --exclude-group no-ci
phpunit -c tests/phpunit_eco.xml --list-suites $EARLY_DESC \
&& phpunit -c tests/phpunit_eco.xml $EARLY_DESC \
&& phpunit -c tests/phpunit_db.xml --list-suites $EARLY_DESC \
&& phpunit -c tests/phpunit_db.xml --exclude-group no-ci $EARLY_DESC \
&& phpunit -c tests/phpunit_js.xml --list-suites $EARLY_DESC \
&& phpunit -c tests/phpunit_js.xml --exclude-group no-ci $EARLY_DESC \
&& cd cosmogramme/tests \
&& phpunit --list-suites $EARLY_DESC \
&& phpunit --exclude-group no-ci $EARLY_DESC \
&& cd ../cosmozend/tests \
&& phpunit --list-suites $EARLY_DESC \
&& phpunit --exclude-group no-ci $EARLY_DESC
#!/bin/bash
DBNAME=$1
DBUSER=$2
DBPASS=$3
DBHOST=$4
source ./build_bokeh_config.sh $DBNAME $DBUSER $DBPASS $DBHOST
EARLY_DESC=`php -r "echo version_compare(PHP_VERSION, '8.1', '>=') ? '--fail-error-with-desc' : '';"`
phpunit -c tests/phpunit_scenario.xml --list-suites $EARLY_DESC \
&& phpunit -c tests/phpunit_scenario.xml --exclude-group no-ci $EARLY_DESC
......@@ -172,6 +172,15 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
}
protected function _printMemory() : void {
$memory_usage = round((memory_get_usage() / (1024*1024)), 0);
$memory_limit = round(((int) ini_get('memory_limit') ), 0);
echo printf("%s / %s\n",
$memory_usage,
$memory_limit);
}
public function tearDown() {
new TearDown($this->_storm_default_to_volatile,
$this->_registry_sql,
......
......@@ -97,7 +97,6 @@ require_once 'tests/fixtures/MockedClasses.php';
require_once 'tests/application/modules/telephone/controllers/TelephoneAbstractControllerTestCase.php';
require_once 'tests/js/BrowserTest.php';
register_shutdown_function(function(){
TestSpeedTrap::printSpeedTrappedTests();
});
register_shutdown_function(fn() => TestSpeedTrap::printSpeedTrappedTests());
?>
......@@ -6,10 +6,10 @@
stopOnFailure="false"
stopOnError="false"
failErrorWithDesc="false"
cacheTokens="false"
>
<testsuites>
<testsuite name="Bokeh scenario, application, library and digital resources">
<directory>./scenarios/</directory>
<testsuite name="Bokeh application, library and digital resources">
<directory>./application/</directory>
<directory>./library/</directory>
<directory>../library/digital_resources/</directory>
......
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="./bootstrap.php"
colors="false"
backupGlobals="false"
stopOnFailure="false"
stopOnError="false"
failErrorWithDesc="false"
cacheTokens="false"
>
<testsuites>
<testsuite name="Bokeh scenario">
<directory>./scenarios/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../application</directory>
<directory suffix=".php">../library/Class</directory>
<directory suffix=".php">../library/Trait</directory>
<directory suffix=".php">../library/ZendAfi</directory>
<directory suffix=".php">../library/fonctions</directory>
<directory suffix=".php">../library/digital_resources</directory>
<directory suffix=".php">../library/templates</directory>
<directory suffix=".php">./js/</directory>
<exclude>
<file>../index.php</file>
<directory>../library/Class/Pdf</directory>
<directory>../library/Thumbs</directory>
<directory>../library/storm/tests/Storm</directory>
</exclude>
</whitelist>
</filter>
<listeners>
<listener file="./TestSpeedTrap.php" class="TestSpeedTrap"/>
</listeners>
</phpunit>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment