Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation test #968

Merged
merged 9 commits into from
Nov 2, 2023
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
120 changes: 113 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
jobs:
cs-fix:
name: Run code style check
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php:
- '8.0'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -26,7 +26,7 @@ jobs:
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"

Expand All @@ -35,7 +35,7 @@ jobs:

tests:
name: Tests
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
timeout-minutes: 10

strategy:
Expand All @@ -47,7 +47,7 @@ jobs:
- '8.1'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -57,7 +57,7 @@ jobs:
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --no-progress"
Expand All @@ -66,7 +66,113 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run test suite
run: composer run-script --timeout=600 test
run: composer run-script --timeout=600 test-unit

- name: Run PHPStan analysis
run: composer run-script phpstan

integration-tests-postgres:
name: PostgreSQL integration tests
needs: tests
services:
postgres:
image: postgres:10
ports:
- 5432
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--tmpfs /var/lib/postgresql/data
runs-on: "ubuntu-22.04"
timeout-minutes: 20

strategy:
matrix:
php:
- '7.4'
- '8.0'
- '8.1'

steps:
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_pgsql, gd
tools: cs2pr

- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run integration test suite on Postgres
run: composer run-script --timeout=600 test-integration
env:
SEARCH_ENGINE: legacy
DATABASE_URL: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb?server_version=10"

integration-tests-mysql:
name: MySQL integration tests
needs: tests

services:
mysql:
image: ghcr.io/ibexa/core/mysql
ports:
- 3306/tcp
env:
MYSQL_RANDOM_ROOT_PASSWORD: true
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: testdb
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
--tmpfs=/var/lib/mysql
runs-on: "ubuntu-22.04"
timeout-minutes: 20

strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'

steps:
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_mysql, gd
tools: cs2pr

- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run integration test suite vs MySQL
run: composer run-script --timeout=600 test-integration
env:
SEARCH_ENGINE: legacy
DATABASE_URL: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb"
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"psr-4": {
"Ibexa\\Tests\\Bundle\\AdminUi\\": "tests/bundle/",
"Ibexa\\Tests\\AdminUi\\": "tests/lib/",
"Ibexa\\Tests\\Integration\\AdminUi\\": "tests/integration/",
"EzSystems\\EzPlatformAdminUi\\Tests\\": "tests/lib/",
"Ibexa\\Platform\\Tests\\Assets\\": "tests/lib/"
}
Expand Down Expand Up @@ -63,6 +64,7 @@
"twig/string-extra": "^3.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^v6.7",
"ibexa/ci-scripts": "^0.2@dev",
"ibexa/behat": "~4.6.0@dev",
"friendsofphp/php-cs-fixer": "^3.0",
Expand All @@ -71,9 +73,11 @@
"ibexa/doctrine-schema": "~4.6.0@dev",
"ibexa/http-cache": "~4.6.0@dev",
"ibexa/code-style": "^1.0",
"ibexa/test-core": "^0.1.x-dev",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.3"
"phpstan/phpstan-symfony": "^1.3",
"symfony/webpack-encore-bundle": "^1.17.2"
},
"config": {
"allow-plugins": {
Expand All @@ -84,7 +88,9 @@
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"phpstan": "phpstan analyse",
"test": "phpunit -c phpunit.xml"
"test": ["@test-unit", "@test-integration"],
"test-unit": "phpunit -c phpunit.xml",
"test-integration": "phpunit -c phpunit.integration.xml"
},
"extra": {
"branch-alias": {
Expand Down
30 changes: 0 additions & 30 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3685,16 +3685,6 @@ parameters:
count: 1
path: src/lib/Event/Options.php

-
message: "#^Call to method getEntrypointLookup\\(\\) on an unknown class Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\EntrypointLookupCollectionInterface\\.$#"
count: 1
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Call to method reset\\(\\) on an unknown class Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\TagRenderer\\.$#"
count: 1
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Cannot call method log\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#"
count: 1
Expand All @@ -3715,26 +3705,6 @@ parameters:
count: 1
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Parameter \\$encoreTagRenderer of method Ibexa\\\\AdminUi\\\\EventListener\\\\AdminExceptionListener\\:\\:__construct\\(\\) has invalid type Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\TagRenderer\\.$#"
count: 2
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Parameter \\$entrypointLookupCollection of method Ibexa\\\\AdminUi\\\\EventListener\\\\AdminExceptionListener\\:\\:__construct\\(\\) has invalid type Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\EntrypointLookupCollectionInterface\\.$#"
count: 2
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Property Ibexa\\\\AdminUi\\\\EventListener\\\\AdminExceptionListener\\:\\:\\$encoreTagRenderer has unknown class Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\TagRenderer as its type\\.$#"
count: 1
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Property Ibexa\\\\AdminUi\\\\EventListener\\\\AdminExceptionListener\\:\\:\\$entrypointLookupCollection has unknown class Symfony\\\\WebpackEncoreBundle\\\\Asset\\\\EntrypointLookupCollectionInterface as its type\\.$#"
count: 1
path: src/lib/EventListener/AdminExceptionListener.php

-
message: "#^Property Ibexa\\\\AdminUi\\\\EventListener\\\\AdminExceptionListener\\:\\:\\$siteAccessGroups type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
25 changes: 25 additions & 0 deletions phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/integration/bootstrap.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
failOnWarning="true"
colors="true">
<testsuites>
<testsuite name="integration">
<directory>tests/integration</directory>
</testsuite>
</testsuites>
<php>
<env name="DATABASE_URL" value="sqlite://i@i/var/test.db" />
<env name="KERNEL_CLASS" value="Ibexa\Tests\Integration\AdminUi\AdminUiIbexaTestKernel" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0&amp;verbose=0"/>
</php>
<extensions>
<extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
</extensions>
</phpunit>
4 changes: 2 additions & 2 deletions src/bundle/Resources/config/services/components.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
imports:
- { resource: services/components/content/edit.yaml }
- { resource: services/components/content_type/edit.yaml }
- { resource: components/content/edit.yaml }
- { resource: components/content_type/edit.yaml }

services:
_defaults:
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
public: false

Ibexa\AdminUi\EventListener\:
resource: "../../../lib/EventListener/*"
resource: "../../../../lib/EventListener/*"
public: true
tags:
- { name: kernel.event_subscriber }
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/form_processors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
public: false

Ibexa\AdminUi\Form\Processor\:
resource: "../../../lib/Form/Processor/*"
resource: "../../../../lib/Form/Processor/*"
public: true
tags:
- { name: kernel.event_subscriber }
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/tabs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
lazy: true

Ibexa\AdminUi\Tab\Event\Subscriber\:
resource: "../../../lib/Tab/Event/Subscriber/*"
resource: "../../../../lib/Tab/Event/Subscriber/*"
public: true
tags: ['kernel.event_subscriber']

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
Ibexa\AdminUi\Tab\ContentType\:
resource: "../../../lib/Tab/ContentType/*"
resource: "../../../../../lib/Tab/ContentType/*"
parent: Ibexa\Contracts\AdminUi\Tab\AbstractEventDispatchingTab
public: true
tags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
Ibexa\AdminUi\Tab\LocationView\:
resource: "../../../lib/Tab/LocationView/*"
resource: "../../../../../lib/Tab/LocationView/*"
parent: Ibexa\Contracts\AdminUi\Tab\AbstractTab
public: true
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- { name: twig.extension }

Ibexa\AdminUi\UniversalDiscovery\Event\Subscriber\:
resource: "../../../lib/UniversalDiscovery/Event/Subscriber/*"
resource: "../../../../lib/UniversalDiscovery/Event/Subscriber/*"
public: true
tags: ['kernel.event_subscriber']

Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
public: false

Ibexa\AdminUi\Util\:
resource: "../../../lib/Util"
resource: "../../../../lib/Util"
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/validators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
public: false

Ibexa\AdminUi\Validator\Constraints\:
resource: "../../../lib/Validator/Constraints"
resource: "../../../../lib/Validator/Constraints"

Ibexa\AdminUi\Validator\Constraints\LocationIsWithinCopySubtreeLimitValidator:
arguments:
Expand Down
Loading
Loading