Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Workaround of MySQLi transaction limitations on DDL statements execution in tests, add cast service for driver #75

Workaround of MySQLi transaction limitations on DDL statements execution in tests, add cast service for driver

Workaround of MySQLi transaction limitations on DDL statements execution in tests, add cast service for driver #75

Workflow file for this run

name: Pull Request Testing
on:
pull_request:
branches: [ main ]
env:
SIMPLETEST_BASE_URL: "http://localhost:8080"
BROWSERTEST_OUTPUT_DIRECTORY: "sites/default/files/simpletest"
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://localhost:4444"]'
PHPUNIT_SKIP_CLASS: '[
"Drupal\\KernelTests\\Core\\Cache\\ApcuBackendTest",
"Drupal\\Tests\\file\\Functional\\FileAddPermissionsUpdateTest"
]'
jobs:
#################################
mysqli:
name: "Test mysqli"
runs-on: ubuntu-20.04
env:
SIMPLETEST_DB: "mysqli://root:@0.0.0.0/drupal_db?module=mysqli#d10t"
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
test-args:
- "--group Database"
# - "--group Installer"
# - "--group field,Field"
# - "--group File"
# - "-v --group views"
services:
mysql:
image: "mysql:5.7"
options: >-
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
-e MYSQL_DATABASE=drupal_db
ports:
- "3306:3306"
steps:
# - name: Install Chrome
# uses: "browser-actions/setup-chrome@latest"
# - name: Check Chrome version
# run: chrome --version
# - name: Install Chromedriver
# uses: "nanasess/setup-chromedriver@master"
# - name: Run Chromedriver
# run: chromedriver --port=4444 &
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
extensions: "mysqli, apcu"
ini-values: "zend.assertions=1"
- name: Checkout Drupal
run: git clone --depth=5 --branch=11.x http://git.drupal.org/project/drupal.git .
- name: Checkout mysqli module
uses: actions/checkout@v3
with:
path: mysqli_staging
- name: Patch Drupal
run: ./mysqli_staging/tests/github/drupal_patch.sh
- name: Install Composer dependencies
run: composer install --no-progress --ansi
- name: Composer require mysqli from local staging
run: |
git -C mysqli_staging checkout -b test-run-branch
composer config repositories.test-run '{"type": "path", "url": "mysqli_staging", "options": {"symlink": false}}'
composer require "mondrake/mysqli:dev-test-run-branch" --no-progress --ansi
- name: Install Drupal
run: |
cp mysqli_staging/tests/github/install_* .
# Install via Drush.
vendor/bin/drush site-install standard --db-url=$SIMPLETEST_DB -y
# Report installation status.
php install_report.php
vendor/bin/drush core:status
vendor/bin/drush core:requirements
vendor/bin/drush pml --type=module --no-core
# Spin a test webserver.
mkdir -p sites/default/files/simpletest
vendor/bin/drush runserver localhost:8080 --default-server=localhost:8080 &
sleep 1s
- name: Run tests ${{ matrix.test-args }}
continue-on-error: true
run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }}
# run: vendor/bin/phpunit -c core --color=always modules/contrib/mysqli/tests/src/Kernel/mysqli/TransactionTest.php
# - uses: actions/upload-artifact@v3
# with:
# name: test-results
# path: sites/simpletest/browser_output