Import test-selenium from the master branch
- Adjust for QA - Add node-version variable Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
8da964fa40
commit
5139170303
59
.github/workflows/test-selenium.yml
vendored
59
.github/workflows/test-selenium.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Run Selenium tests
|
||||
name: "End-to-End tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -11,14 +11,18 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
php-version: "7.2"
|
||||
node-version: "12"
|
||||
|
||||
jobs:
|
||||
test-selenium:
|
||||
name: Selenium tests on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
|
||||
selenium:
|
||||
name: "Selenium"
|
||||
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: "ubuntu-latest"
|
||||
services:
|
||||
database-server:
|
||||
image: ${{ matrix.db-server }}
|
||||
image: "mysql:5.7"
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: testbench
|
||||
ports:
|
||||
@ -53,10 +57,30 @@ jobs:
|
||||
--cap-add=NET_RAW
|
||||
--restart on-failure
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-version: ["7.2"]
|
||||
os: [ubuntu-latest]
|
||||
db-server: ["mysql:5.7"]
|
||||
test-name:
|
||||
- "ChangePassword"
|
||||
- "CreateDropDatabase"
|
||||
- "CreateRemoveUser"
|
||||
- "Database/Events"
|
||||
- "Database/Operations"
|
||||
- "Database/Procedures"
|
||||
- "Database/Structure"
|
||||
- "Export"
|
||||
- "Import"
|
||||
- "Login"
|
||||
- "Normalization"
|
||||
- "ServerSettings"
|
||||
- "SqlQuery"
|
||||
- "Table/Browse"
|
||||
- "Table/Create"
|
||||
- "Table/Insert"
|
||||
- "Table/Operations"
|
||||
- "Table/Structure"
|
||||
- "Tracking"
|
||||
- "Triggers"
|
||||
- "Xss"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
@ -67,21 +91,20 @@ jobs:
|
||||
- name: Generate mo files
|
||||
run: ./scripts/generate-mo --quiet
|
||||
|
||||
- name: Set up PHP ${{ matrix.php-version }}
|
||||
- name: Set up PHP ${{ env.php-version }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
extensions: mbstring, iconv, mysqli, zip, gd, bz2
|
||||
coverage: "none"
|
||||
php-version: ${{ env.php-version }}
|
||||
extensions: :opcache, mbstring, iconv, mysqli, zip, gd, bz2
|
||||
|
||||
- name: Install Composer dependencies
|
||||
uses: ramsey/composer-install@v3
|
||||
with:
|
||||
dependency-versions: highest
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: '${{ env.node-version }}'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install modules
|
||||
@ -93,9 +116,11 @@ jobs:
|
||||
- name: Start server
|
||||
env:
|
||||
CI_MODE: selenium
|
||||
FPM_PATH: php-fpm7.2
|
||||
FPM_PATH: php-fpm${{ env.php-version }}
|
||||
SKIP_STANDALONE: 1
|
||||
run: |
|
||||
sudo chown -R runner:docker /var/lib/nginx/
|
||||
sudo chown -R runner:docker /var/log/nginx/
|
||||
./test/start-local-server
|
||||
echo "SELENIUM_TEMPDIR=$(cat /tmp/last_temp_dir_phpMyAdminTests)" >> $GITHUB_OUTPUT
|
||||
id: start-local-server
|
||||
@ -111,7 +136,7 @@ jobs:
|
||||
TESTSUITE_DATABASE_PREFIX: "selenium"
|
||||
TESTSUITE_SELENIUM_HOST: "127.0.0.1"
|
||||
TESTSUITE_SELENIUM_PORT: "4444"
|
||||
run: ./vendor/bin/phpunit --testsuite selenium --verbose --debug --no-coverage --stop-on-skipped
|
||||
run: ./vendor/bin/phpunit --testsuite selenium --no-logging --no-coverage --stop-on-skipped --testdox test/selenium/${{ matrix.test-name }}Test.php
|
||||
|
||||
- name: Output logs and stop server
|
||||
env:
|
||||
@ -127,6 +152,6 @@ jobs:
|
||||
uses: actions/upload-artifact@v6
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: selenium-screenshots
|
||||
name: selenium-screenshots-${{ strategy.job-index }}
|
||||
path: ${{ github.workspace }}/build/selenium/**/*
|
||||
retention-days: 3
|
||||
|
||||
Loading…
Reference in New Issue
Block a user