Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,6 +20,8 @@ public function registerBundles(): iterable
{
yield from parent::registerBundles();

yield new IbexaTestCoreBundle();

yield new IbexaCorePersistenceBundle();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/Resources/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
autowire: true
autoconfigure: true
public: false
bind:
$connection: '@ibexa.persistence.connection'

Ibexa\Tests\Integration\CorePersistence\Fixtures\FooGateway: ~

Expand Down
38 changes: 2 additions & 36 deletions tests/integration/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();