Skip to content

Commit

Permalink
Test /w Oracle 18c (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Jan 23, 2022
1 parent c0e89e7 commit 3cb026a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: atk4_pass
oracle:
image: ghcr.io/mvorisek/docker-oracle-xe-11g
image: gvenzl/oracle-xe:18
env:
ORACLE_ALLOW_REMOTE: true
ORACLE_PASSWORD: atk4_pass
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -196,18 +196,16 @@ jobs:
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mssql.cov; fi
- name: "Run tests: Oracle (only for coverage or cron)"
if: env.LOG_COVERAGE || github.event_name == 'schedule'
- name: "Run tests: Oracle"
env:
DB_DSN: "oci:dbname=oracle/xe"
DB_USER: system
DB_PASSWORD: oracle
DB_PASSWORD: atk4_pass
NLS_LANG: AMERICAN_AMERICA.AL32UTF8
run: |
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
php demos/_demo-data/create-db.php
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v \
|| php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-oracle.cov; fi
- name: Upload coverage logs 1/2 (only for latest Phpunit)
Expand Down Expand Up @@ -260,9 +258,9 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: atk4_pass
oracle:
image: ghcr.io/mvorisek/docker-oracle-xe-11g
image: gvenzl/oracle-xe:18
env:
ORACLE_ALLOW_REMOTE: true
ORACLE_PASSWORD: atk4_pass
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -406,13 +404,12 @@ jobs:
env:
DB_DSN: "oci:dbname=oracle/xe"
DB_USER: system
DB_PASSWORD: oracle
DB_PASSWORD: atk4_pass
NLS_LANG: AMERICAN_AMERICA.AL32UTF8
run: |
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
php demos/_demo-data/create-db.php
vendor/bin/behat -vv --config behat.yml.dist \
|| vendor/bin/behat -vv --config behat.yml.dist
vendor/bin/behat -vv --config behat.yml.dist
- name: Upload coverage logs 1/2 (only for latest Chrome)
if: env.LOG_COVERAGE
Expand Down
5 changes: 5 additions & 0 deletions demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ public function importFromFilesystem(string $path, bool $isSub = null): void
$this->atomic(function () use ($path) {
foreach ($this as $entity) {
$entity->delete();

// skip full/slow import for Behat testing
if ($_ENV['CI'] ?? null) {
break;
}
}

$path = __DIR__ . '/../' . $path;
Expand Down

0 comments on commit 3cb026a

Please sign in to comment.