Skip to content

Commit

Permalink
Merge pull request #46 from City-of-Helsinki/UHF-X-container-chromium
Browse files Browse the repository at this point in the history
Use separate chromium container
  • Loading branch information
tuutti authored Oct 7, 2023
2 parents e08ff75 + 54a8de1 commit ed63e6e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: CI
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
BROWSERTEST_OUTPUT_DIRECTORY: 'public/sites/simpletest'
SIMPLETEST_BASE_URL: http://app:8888
jobs:
tests:
runs-on: ubuntu-latest
Expand All @@ -15,8 +16,13 @@ jobs:
php-versions: ['8.1', '8.2']
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine
options: --hostname app

services:
chromium:
# @todo Update this to newer version once minkphp supports Selenium 4.
# @see https://github.com/minkphp/MinkSelenium2Driver/pull/372
image: selenium/standalone-chrome:106.0
db:
image: mariadb
env:
Expand Down Expand Up @@ -71,8 +77,7 @@ jobs:
- name: Start services
working-directory: ${{ env.DRUPAL_ROOT }}
run: |
vendor/bin/drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
chromedriver --port=4444 > /dev/null 2>&1 &
vendor/bin/drush runserver $SIMPLETEST_BASE_URL --dns > /dev/null 2>&1 &
- name: Run PHPUnit tests
working-directory: ${{ env.DRUPAL_ROOT }}
Expand Down
29 changes: 15 additions & 14 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
colors="true"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="true"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"
failOnRisky="true"
failOnWarning="true"
verbose="true">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
colors="true"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="true"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"
failOnRisky="true"
failOnWarning="true"
failOnSkipped="true"
verbose="true">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"w3c": false, "args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://127.0.0.1:4444"]' />
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"w3c": false}}, "http://chromium:4444"]' />
</php>
<testsuites>
<testsuite name="unit">
Expand Down

0 comments on commit ed63e6e

Please sign in to comment.