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
5 changes: 3 additions & 2 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
php:
- '8.1'
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
Expand All @@ -42,7 +42,7 @@ jobs:
- '8.4'

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
Expand All @@ -65,3 +65,4 @@ jobs:
functional-tests:
name: "REST functional tests"
uses: ./.github/workflows/integration-tests-callable.yaml
secrets: inherit
46 changes: 35 additions & 11 deletions .github/workflows/integration-tests-callable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
PHP_INI_ENV_memory_limit: 512M
COMPOSER_CACHE_DIR: ~/.composer/cache
PROJECT_EDITION: oss
SETUP: "doc/docker/base-dev.yml:doc/docker/selenium.yml"
SETUP: "doc/docker/base-dev.yml"
WEB_HOST: web

jobs:
Expand All @@ -19,36 +19,47 @@ jobs:
matrix:
include:
- php: '7.4'
node: 18
node: 20
- php: '8.3'
node: 22
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Set project version
run: |
version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json)
echo "version=$version" >> $GITHUB_ENV

- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
owner: ${{ github.repository_owner }}

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Ignore unsolvable advisories for PHP versions past EOL
uses: ibexa/gh-workflows/actions/composer-audit-ignore@main
with:
php-version: '${{ matrix.php }}'
github-token: ${{ steps.generate_token.outputs.token }}

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: ${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }}
restore-keys: |
${{ env.PROJECT_EDITION }}-${{ env.version }}

- name: Add composer key for GitHub App
if: ${{ steps.generate_token.outputs.token != '' }}
run: |
composer config github-oauth.github.com $GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Set up whole project using the tested dependency
run: |
curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.version }}/prepare_project_edition.sh" > prepare_project_edition.sh
Expand All @@ -60,7 +71,20 @@ jobs:
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'"

- name: Run tests
- name: Configure composer inside vendor/ibexa/rest
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "
cd vendor/ibexa/rest &&
curl -fsSLO https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/_common/configure_composer_audit_ignores.sh &&
bash configure_composer_audit_ignores.sh &&
composer update
"

- name: Run tests inside vendor/ibexa/rest against configured instance
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer test-functional"
docker compose --env-file=.env exec -T --user www-data -e EZP_TEST_REST_HOST=$WEB_HOST app sh -c "
cd vendor/ibexa/rest &&
composer test-functional
"
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xmlwriter": "*",
"ibexa/core": "~4.6.0@dev",
"ibexa/core": "~4.6.x-dev",
"symfony/http-kernel": "^5.3",
"symfony/dependency-injection": "^5.3",
"symfony/routing": "^5.3",
Expand All @@ -46,8 +46,7 @@
"lexik/jwt-authentication-bundle": "^2.8"
},
"require-dev": {
"ibexa/ci-scripts": "^0.2@dev",
"ibexa/doctrine-schema": "~4.6.0@dev",
"ibexa/doctrine-schema": "~4.6.x-dev",
"ibexa/code-style": "^1.0",
"ibexa/test-core": "^0.1.x-dev",
"friendsofphp/php-cs-fixer": "^3.0",
Expand Down
6 changes: 3 additions & 3 deletions tests/bundle/Functional/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testDeletedSessionCookieCannotReauthenticate(): void
);
$currentSessionResponse = $this->sendHttpRequest($currentSessionRequest);
self::assertHttpResponseCodeEquals($currentSessionResponse, 200);
$authenticatedData = json_decode($currentSessionResponse->getBody()->getContents(), true, JSON_THROW_ON_ERROR);
$authenticatedData = json_decode($currentSessionResponse->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
$authenticatedUserHref = $authenticatedData['Session']['User']['_href'];

// Logout
Expand All @@ -178,7 +178,7 @@ public function testDeletedSessionCookieCannotReauthenticate(): void
)
);

$reusedData = json_decode($reusedResponse->getBody()->getContents(), true, JSON_THROW_ON_ERROR);
$reusedData = json_decode($reusedResponse->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
self::assertNotEquals(
$authenticatedUserHref,
$reusedData['Session']['User']['_href'],
Expand Down Expand Up @@ -220,7 +220,7 @@ public function testCheckSession(): void
$response = $this->sendHttpRequest($request);
self::assertHttpResponseCodeEquals($response, 200);
$contents = $response->getBody()->getContents();
$data = json_decode($contents, true, JSON_THROW_ON_ERROR);
$data = json_decode($contents, true, 512, JSON_THROW_ON_ERROR);
self::assertArrayHasKey('Session', $data);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bundle/Functional/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ protected function login(): \stdClass
$response = $this->sendHttpRequest($request);
self::assertHttpResponseCodeEquals($response, 201);

return json_decode($response->getBody()->getContents(), false, JSON_THROW_ON_ERROR)->Session;
return json_decode($response->getBody()->getContents(), false, 512, JSON_THROW_ON_ERROR)->Session;
}

/**
Expand Down