diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index f7bc485..831b8b6 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -50,9 +50,12 @@ jobs: coverage: none extensions: pdo_sqlite, gd - - uses: ramsey/composer-install@v3 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - dependency-versions: highest + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -100,9 +103,12 @@ jobs: extensions: pdo_pgsql, gd tools: cs2pr - - uses: ramsey/composer-install@v3 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - dependency-versions: highest + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -152,9 +158,12 @@ jobs: extensions: pdo_mysql, gd tools: cs2pr - - uses: ramsey/composer-install@v3 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - dependency-versions: highest + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" diff --git a/tests/integration/Kernel.php b/tests/integration/Kernel.php index 6835372..abda62c 100644 --- a/tests/integration/Kernel.php +++ b/tests/integration/Kernel.php @@ -9,6 +9,7 @@ namespace Ibexa\Tests\Integration\CorePersistence; use Ibexa\Bundle\CorePersistence\IbexaCorePersistenceBundle; +use Ibexa\Bundle\Test\Core\IbexaTestCoreBundle; use Ibexa\Contracts\CorePersistence\Gateway\DoctrineSchemaMetadataRegistryInterface; use Ibexa\Contracts\Test\Core\IbexaTestKernel; use Symfony\Component\Config\Loader\LoaderInterface; @@ -19,6 +20,8 @@ public function registerBundles(): iterable { yield from parent::registerBundles(); + yield new IbexaTestCoreBundle(); + yield new IbexaCorePersistenceBundle(); } diff --git a/tests/integration/Resources/services.yaml b/tests/integration/Resources/services.yaml index d0f4d09..7184cef 100644 --- a/tests/integration/Resources/services.yaml +++ b/tests/integration/Resources/services.yaml @@ -3,6 +3,8 @@ services: autowire: true autoconfigure: true public: false + bind: + $connection: '@ibexa.persistence.connection' Ibexa\Tests\Integration\CorePersistence\Fixtures\FooGateway: ~ diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php index 4144ed7..8237b96 100644 --- a/tests/integration/bootstrap.php +++ b/tests/integration/bootstrap.php @@ -6,44 +6,10 @@ */ declare(strict_types=1); -use Ibexa\Contracts\Core\Test\Persistence\Fixture\FixtureImporter; -use Ibexa\Tests\Core\Repository\LegacySchemaImporter; -use Symfony\Bundle\FrameworkBundle\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; +use Ibexa\Contracts\Test\Core\Bootstrapper\Bootstrapper; require_once dirname(__DIR__, 2) . '/vendor/autoload.php'; chdir(dirname(__DIR__, 2)); -$kernel = new \Ibexa\Tests\Integration\CorePersistence\Kernel('test', true); -$kernel->boot(); - -$application = new Application($kernel); -$application->setAutoExit(false); - -$databaseUrl = getenv('DATABASE_URL'); -if ($databaseUrl !== false && !str_starts_with($databaseUrl, 'sqlite')) { - $application->run(new ArrayInput([ - 'command' => 'doctrine:database:drop', - '--if-exists' => '1', - '--force' => '1', - ])); -} - -$application->run(new ArrayInput([ - 'command' => 'doctrine:database:create', -])); - -/** @var \Psr\Container\ContainerInterface $testContainer */ -$testContainer = $kernel->getContainer()->get('test.service_container'); - -$schemaImporter = $testContainer->get(LegacySchemaImporter::class); -foreach ($kernel->getSchemaFiles() as $file) { - $schemaImporter->importSchema($file); -} - -$fixtureImporter = $testContainer->get(FixtureImporter::class); -foreach ($kernel->getFixtures() as $fixture) { - $fixtureImporter->import($fixture); -} -$kernel->shutdown(); +(new Bootstrapper())->bootstrap();