Skip to content

BUGFIX: Repair behat tests and Neos9-Beta-10 compatibility #86

BUGFIX: Repair behat tests and Neos9-Beta-10 compatibility

BUGFIX: Repair behat tests and Neos9-Beta-10 compatibility #86

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
env:
FLOW_CONTEXT: Testing
NEOS_TARGET_VERSION: '9.0'
NEOS_BASE_FOLDER: neos-base-distribution
PACKAGE_FOLDER: redirect-neosadapter
COMPOSER_ALLOW_SUPERUSER: 1
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.2']
services:
mariadb:
# see https://mariadb.com/kb/en/mariadb-server-release-dates/
# this should be a current release, e.g. the LTS version
image: mariadb:10.8
env:
MYSQL_USER: neos
MYSQL_PASSWORD: neos
MYSQL_DATABASE: neos_functional_testing
MYSQL_ROOT_PASSWORD: neos
ports:
- "3306:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
with:
path: ${{ env.PACKAGE_FOLDER }}
- name: Set package branch name
run: echo "PACKAGE_TARGET_VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
working-directory: .
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
coverage: xdebug #optional
ini-values: opcache.fast_shutdown=0
- name: Update Composer
run: |
sudo composer self-update
composer --version
# Directory permissions for .composer are wrong, so we remove the complete directory
# https://github.com/actions/virtual-environments/issues/824
- name: Delete .composer directory
run: |
sudo rm -rf ~/.composer
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Checkout development distribution
uses: actions/checkout@v2
with:
repository: neos/neos-development-distribution
ref: ${{ env.NEOS_TARGET_VERSION }}
path: ${{ env.NEOS_BASE_FOLDER }}
- name: Prepare external packages for development distribution
run: |
cd ${NEOS_BASE_FOLDER}
composer require --no-update --no-interaction neos/redirecthandler:"^6.0"
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:"^6.0"
git -C ../${{ env.PACKAGE_FOLDER }} checkout -b build
composer config repositories.package '{ "type": "path", "url": "../${{ env.PACKAGE_FOLDER }}", "options": { "symlink": false } }'
composer require --no-update --no-interaction neos/redirecthandler-neosadapter:"dev-build as dev-${PACKAGE_TARGET_VERSION}"
- name: Composer Install
run: |
cd ${NEOS_BASE_FOLDER}
composer update --no-interaction --no-progress
- name: Setup Flow configuration
run: |
cd ${NEOS_BASE_FOLDER}
mkdir -p Configuration/Testing
rm -f Configuration/Testing/Settings.yaml
cat <<EOF >> Configuration/Testing/Settings.yaml
Neos:
Flow:
persistence:
backendOptions:
host: '127.0.0.1'
driver: pdo_mysql
user: 'neos'
password: 'neos'
dbname: 'neos_functional_testing'
EOF
- name: Setup database schema
run: |
cd ${NEOS_BASE_FOLDER}
./flow doctrine:migrate --quite
- name: Setup CR
run: |
cd ${NEOS_BASE_FOLDER}
./flow cr:setup
- name: Run Behavioral tests
run: |
cd ${NEOS_BASE_FOLDER}
bin/behat -f progress --strict --no-interaction -vvv --stop-on-failure -c Packages/Application/Neos.RedirectHandler.NeosAdapter/Tests/Behavior/behat.yml.dist
- name: Show log on failure
if: ${{ failure() }}
run: |
cd ${NEOS_BASE_FOLDER}
cat Data/Logs/System_Testing.log