Skip to content

Commit

Permalink
Make unit tests fail from cliupdate aswell
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 15, 2018
1 parent 1c2ae4d commit 54cda93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ shared: &shared
mysql -h 127.0.0.1 -u root -e 'create database glpitest0723;'
mysql -h 127.0.0.1 -u root glpitest0723 < tests/glpi-0.72.3-empty.sql
cp tests/circleci.config_db.php tests/config_db.php
php scripts/cliupdate.php --config-dir=../tests --dev
php scripts/cliupdate.php --config-dir=../tests --dev |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
php scripts/cliupdate.php --config-dir=../tests --dev --tests
php scripts/cliupdate.php --config-dir=../tests --dev --tests |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
php scripts/innodb_migration.php --config-dir=../tests
rm tests/config_db.php
- run:
name: Install DB
command: |
mysql -h 127.0.0.1 -u root -e 'create database glpitest;'
php scripts/cliinstall.php --db=glpitest --host=127.0.0.1 --user=root --tests
php scripts/cliupdate.php --config-dir=../tests |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
php scripts/cliupdate.php --config-dir=../tests --tests |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
- run:
name: Database tests
command: php vendor/bin/atoum -p 'php -d memory_limit=512M' --debug --force-terminal --use-dot-report --configurations tests/telemetry.php --bootstrap-file tests/bootstrap.php --no-code-coverage --max-children-number 1 -d tests/database
Expand Down
4 changes: 4 additions & 0 deletions scripts/cliupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
}
}

if (isset($args['tests'])) {
define('TU_USER', 'CLI');
}

if (isset($args['config-dir'])) {
define("GLPI_CONFIG_DIR", $args['config-dir']);
}
Expand Down

0 comments on commit 54cda93

Please sign in to comment.