Skip to content

CI: Support multi-channel WEB_HOST and database routing for parallel Behat tests - #213

Open
ibexa-yuna wants to merge 9 commits into
6.0from
ci-optimizations
Open

ibexa-yuna wants to merge 9 commits into
6.0from
ci-optimizations

Conversation

@ibexa-yuna

@ibexa-yuna ibexa-yuna commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Enables multi-process Behat test execution without collisions by dynamically routing Mink web requests, CLI Doctrine database connections, and cache namespaces based on the active worker channel.

  • Fastest runner: Injects ENV_TEST_CHANNEL_READABLE={p} when executing fastest.
  • Shared channel routing helper (bootstrap_channel.php): Centralizes idempotent channel routing used across all Behat edition configs (behat_ibexa_oss.php, behat_ibexa_commerce.php, behat_ibexa_experience.php, behat_ibexa_headless.php).
  • Dynamic WEB_HOST routing: Rewrites Mink base URL port to 8080 + $channel (e.g. http://web:8081 for process 1, http://web:8082 for process 2), directing requests to the corresponding isolated Nginx port. Bypasses Varnish reverse proxy directly to web container when running in parallel.
  • Dynamic Doctrine DB routing: Rewrites CLI DATABASE_NAME and DATABASE_URL (resolving from $_ENV, $_SERVER, and getenv()) to ${baseDbName}_${channel} with robust parse_url reconstruction so migrations, fixtures, and repository commands act on the process-specific database.
  • Cache namespace isolation: Sets CACHE_NAMESPACE=channel_${channel} in CLI environment to isolate Redis / Valkey caches per worker.
  • Chrome security flags: Whitelists channel ports (8081-8084) under --unsafely-treat-insecure-origin-as-secure.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

…Behat tests

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mnocon
mnocon requested review from katarzynazawada and removed request for mnocon October 22, 2026 06:30
Comment thread composer.json Outdated
ibexa-yuna and others added 3 commits October 22, 2026 09:00
…ckagist collision

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants