Skip to content

Commit 520deb4

Browse files
committed
Fixup tests
1 parent b6809bd commit 520deb4

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
php: ['8.1', '8.2', '8.3', '8.4']
52+
php: ['8.3', '8.4']
5353
steps:
5454
- uses: actions/checkout@v4
5555

@@ -69,12 +69,14 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
php: ['8.1', '8.3']
72+
php: ['8.3']
7373
wp: ['latest']
7474
include:
7575
- php: '8.4'
7676
wp: 'trunk'
7777
env:
78+
MYSQL_HOST: 127.0.0.1
79+
MYSQL_TCP_PORT: 3306
7880
WP_CLI_TEST_DBROOTUSER: root
7981
WP_CLI_TEST_DBROOTPASS: root
8082
WP_CLI_TEST_DBNAME: wp_cli_test
@@ -93,7 +95,9 @@ jobs:
9395

9496
- uses: ramsey/composer-install@v3
9597

96-
- uses: shogo82148/actions-setup-mysql@v1
98+
- name: Setup MySQL
99+
id: setup-mysql
100+
uses: shogo82148/actions-setup-mysql@v1
97101
with:
98102
mysql-version: '8.0'
99103
auto-start: true
@@ -106,7 +110,17 @@ jobs:
106110
- name: Prepare test database
107111
run: composer prepare-tests
108112

113+
- name: Check Behat environment
114+
env:
115+
WP_VERSION: ${{ matrix.wp }}
116+
WP_CLI_TEST_DBTYPE: mysql
117+
WP_CLI_TEST_DBSOCKET: ${{ steps.setup-mysql.outputs.base-dir }}/tmp/mysql.sock
118+
WP_CLI_TEST_DEBUG_BEHAT_ENV: 1
119+
run: composer behat
120+
109121
- name: Run Behat
110122
env:
111123
WP_VERSION: ${{ matrix.wp }}
124+
WP_CLI_TEST_DBTYPE: mysql
125+
WP_CLI_TEST_DBSOCKET: ${{ steps.setup-mysql.outputs.base-dir }}/tmp/mysql.sock
112126
run: composer behat || composer behat-rerun

features/export.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: Export a WordPress site to a Vector archive
1010
"""
1111
Success: Archive created:
1212
"""
13-
And the file full.tar.gz should exist
13+
And the {RUN_DIR}/full.tar.gz file should exist
1414

1515
When I run `wp vector-archive validate {RUN_DIR}/full.tar.gz`
1616
Then the return code should be 0
@@ -22,7 +22,7 @@ Feature: Export a WordPress site to a Vector archive
2222
Scenario: Database-only export excludes files
2323
When I run `wp vector-archive export --scope=database --output={RUN_DIR}/db.tar.gz`
2424
Then the return code should be 0
25-
And the file db.tar.gz should exist
25+
And the {RUN_DIR}/db.tar.gz file should exist
2626

2727
When I run `wp vector-archive info {RUN_DIR}/db.tar.gz --field=scope`
2828
Then STDOUT should be:
@@ -33,7 +33,7 @@ Feature: Export a WordPress site to a Vector archive
3333
Scenario: Files-only export excludes database
3434
When I run `wp vector-archive export --scope=files --output={RUN_DIR}/files.tar.gz`
3535
Then the return code should be 0
36-
And the file files.tar.gz should exist
36+
And the {RUN_DIR}/files.tar.gz file should exist
3737

3838
When I run `wp vector-archive info {RUN_DIR}/files.tar.gz --field=scope`
3939
Then STDOUT should be:

0 commit comments

Comments
 (0)