test: 加入 integration 測試套件(連真實 MariaDB)
從 wp-data-optimizer v3.4.6 移植 5 個 integration 測試檔,並新增 tests/integration/bootstrap.php(複用核心的 integration bootstrap,不重複 與 WP stub)+ phpunit-integration.xml + CI integration job。
This commit is contained in:
@@ -44,3 +44,36 @@ jobs:
|
||||
- name: Run unit tests
|
||||
working-directory: 2meet-data-optimizer-hivepress-addon
|
||||
run: php vendor/bin/phpunit --configuration phpunit.xml --testdox
|
||||
|
||||
integration:
|
||||
name: Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
# Host-mode runner: no service containers. Uses the host MariaDB, same as
|
||||
# the core plugin's integration job.
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 2meet-data-optimizer-hivepress-addon
|
||||
|
||||
- name: Checkout core plugin
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wpdev/2meet-data-optimizer
|
||||
path: 2meet-data-optimizer
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: 2meet-data-optimizer-hivepress-addon
|
||||
run: composer install --no-interaction --prefer-dist
|
||||
|
||||
- name: Install core dev dependencies (test bootstrap needs them)
|
||||
working-directory: 2meet-data-optimizer
|
||||
run: composer install --no-interaction --prefer-dist
|
||||
|
||||
- name: Run integration tests
|
||||
working-directory: 2meet-data-optimizer-hivepress-addon
|
||||
env:
|
||||
TMDO_TEST_DB_HOST: 127.0.0.1
|
||||
TMDO_TEST_DB_USER: dbo
|
||||
TMDO_TEST_DB_PASS: ${{ secrets.TMDO_TEST_DB_PASS }}
|
||||
TMDO_TEST_DB_NAME: wp_wpdo_test
|
||||
run: php vendor/bin/phpunit --configuration phpunit-integration.xml --testdox
|
||||
|
||||
Reference in New Issue
Block a user