Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/performance-blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"steps": [
{
"step": "enableMultisite"
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
]
}
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:
php-tests:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.php-version == '8.5' }}
strategy:
fail-fast: false
matrix:
php-version: ["8.2", "8.3", "8.4", "8.5"]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
services:
Expand Down Expand Up @@ -116,9 +118,11 @@ jobs:
with:
plugins: |
./
blueprint: .github/performance-blueprint.json
wp-version: "6.8"
urls: |
/
create-comment: ${{ github.event_name == 'pull_request' }}
print-results: true
upload-artifacts: true
debug: ${{ runner.debug == '1' }}
debug: true
15 changes: 9 additions & 6 deletions bin/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ install_test_suite() {
recreate_db() {
shopt -s nocasematch
if [[ $1 =~ ^(y|yes)$ ]]; then
mysqladmin drop "$DB_NAME" -f --user="$DB_USER" --password="$DB_PASS""$EXTRA"
# shellcheck disable=SC2086 # $EXTRA must be unquoted for word-splitting
mysqladmin drop "$DB_NAME" -f --user="$DB_USER" --password="$DB_PASS" $EXTRA
create_db
echo "Recreated the database ($DB_NAME)."
else
Expand All @@ -141,7 +142,8 @@ recreate_db() {
}

create_db() {
mysqladmin create "$DB_NAME" --user="$DB_USER" --password="$DB_PASS""$EXTRA"
# shellcheck disable=SC2086 # $EXTRA must be unquoted for word-splitting
mysqladmin create "$DB_NAME" --user="$DB_USER" --password="$DB_PASS" $EXTRA
}

install_db() {
Expand All @@ -157,16 +159,17 @@ install_db() {

if [ -n "$DB_HOSTNAME" ]; then
if echo "$DB_SOCK_OR_PORT" | grep -qe '^[0-9]\{1,\}$'; then
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
EXTRA="--host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
elif [ -n "$DB_SOCK_OR_PORT" ]; then
EXTRA=" --socket=$DB_SOCK_OR_PORT"
EXTRA="--socket=$DB_SOCK_OR_PORT"
elif [ -n "$DB_HOSTNAME" ]; then
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
EXTRA="--host=$DB_HOSTNAME --protocol=tcp"
fi
fi

# create database
if mysql --user="$DB_USER" --password="$DB_PASS""$EXTRA" --execute='show databases;' | grep -q "^${DB_NAME}$"; then
# shellcheck disable=SC2086 # $EXTRA must be unquoted for word-splitting
if mysql --user="$DB_USER" --password="$DB_PASS" $EXTRA --execute='show databases;' | grep -q "^${DB_NAME}$"; then
echo "Reinstalling will delete the existing test database ($DB_NAME)"
read -r -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB
recreate_db "$DELETE_EXISTING_DB"
Expand Down
Loading