From 2cf21ab3bd5cd828d197568a951184ec31d7a676 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 27 Aug 2022 19:38:05 +0200 Subject: [PATCH] Fixed openswoole E2E tests --- .github/workflows/ci.yml | 10 +++++----- config/config.php | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 354c4752..f9d3660e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,11 @@ jobs: with: test-group: unit + cli-tests: + uses: './.github/workflows/ci-tests.yml' + with: + test-group: cli + openswoole-api-tests: uses: './.github/workflows/ci-tests.yml' with: @@ -50,11 +55,6 @@ jobs: - run: ./vendor/bin/rr get --no-interaction --location bin/ && chmod +x bin/rr - run: composer test:api:rr - cli-tests: - uses: './.github/workflows/ci-tests.yml' - with: - test-group: cli - sqlite-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: diff --git a/config/config.php b/config/config.php index 088cad0a..4f4a1359 100644 --- a/config/config.php +++ b/config/config.php @@ -13,11 +13,12 @@ use Shlinkio\Shlink\Config\ConfigAggregator\EnvVarLoaderProvider; use function class_exists; use function Shlinkio\Shlink\Config\env; -use function Shlinkio\Shlink\Config\runningInOpenswoole; use function Shlinkio\Shlink\Config\runningInRoadRunner; +use const PHP_SAPI; + $isTestEnv = env('APP_ENV') === 'test'; -$enableSwoole = ! runningInRoadRunner() && runningInOpenswoole(); +$enableSwoole = PHP_SAPI === 'cli' && ! runningInRoadRunner(); return (new ConfigAggregator\ConfigAggregator([ ! $isTestEnv