Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d18bb5f
Add support for MySQL socket connection
wojtekn Nov 10, 2023
31157da
Fix formatting
wojtekn Nov 10, 2023
7b792ed
Add test for the socket connection
wojtekn Nov 10, 2023
ff8be33
Skip using real database and check if DB_HOST is written
wojtekn Nov 10, 2023
976b7c6
Get the socket from MySQL from the valid connection
danielbachhuber Nov 10, 2023
9468056
Use a file-based socket finder
danielbachhuber Nov 10, 2023
74e0401
Verify STDOUT is not empty
danielbachhuber Nov 10, 2023
7ebb9de
Adjust accepted socket path format to include the host
wojtekn Nov 13, 2023
3a99ee9
Use individual DB variables to avoid defining host twice
wojtekn Nov 13, 2023
f23ed8b
Add quotes to DBHOST argument
schlessera Dec 18, 2023
63cc209
Try preparing the tests against the socket
schlessera Dec 18, 2023
e9264e5
Try using an IP address instead of localhost
schlessera Dec 18, 2023
219fd4f
Revert IP address back to localhost
schlessera Dec 18, 2023
da3b084
Ensure latest wp-cli-tests is pulled in
schlessera Dec 18, 2023
f233cbf
Prepare tests upfront
schlessera Dec 18, 2023
96ee898
Use RUN_DIR variable
schlessera Dec 18, 2023
83cf9ec
Download install-package-tests manually
schlessera Dec 18, 2023
933f20f
Add missing host
schlessera Dec 18, 2023
eea7a6a
Try using IP address instead of localhost
schlessera Dec 18, 2023
d9517e6
Bump required wp-cli-tests version
schlessera Dec 18, 2023
c4a6ee5
Socket protocol only works with localhost
schlessera Dec 18, 2023
700da25
Add root password
schlessera Dec 19, 2023
fc6207e
Account for warnings
schlessera Dec 19, 2023
0f096aa
Remove password for bundled MySQL
schlessera Dec 19, 2023
490535c
Use custom filename first to disambiguate
schlessera Dec 19, 2023
a55018c
Use latest wp-cli-tests
schlessera Dec 20, 2023
90d0465
Adapt socket test
schlessera Dec 20, 2023
5525e65
Remove vendor folder socket dir
schlessera Dec 20, 2023
025fd47
Add comment to test script
schlessera Dec 20, 2023
040008e
Do not check the env-provided socket for validity
schlessera Dec 20, 2023
852c3a0
Use Behat internal var DB_SOCKET
schlessera Dec 20, 2023
aa82b62
Add MYSQL_HOST for socket connection
schlessera Dec 21, 2023
c8e1c33
Simplify MYSQL_HOST
schlessera Dec 21, 2023
10677fe
Add root password
schlessera Dec 21, 2023
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
Prev Previous commit
Next Next commit
Use a file-based socket finder
  • Loading branch information
danielbachhuber committed Nov 10, 2023
commit 94680566c25847c8019d0fecad7672331d7de99d
20 changes: 15 additions & 5 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,24 @@ Feature: Create a wp-config file

@require-mysql
Scenario: Configure with database credentials using socket path
Given a WP install
Given an empty directory
And WP files
And a find-socket.php file:
"""
<?php
if ( file_exists( '/var/run/mysqld/mysqld.sock' ) ) {
echo '/var/run/mysqld/mysqld.sock';
} else if ( file_exists( '/tmp/mysql.sock' ) ) {
echo '/tmp/mysql.sock';
} else {
echo 'No socket found';
exit(1);
}
"""

When I run `wp db query 'SELECT @@GLOBAL.SOCKET' --skip-column-names`
When I run `#!/usr/bin/env php find-socket.php`
Then save STDOUT as {SOCKET}

When I run `rm wp-config.php`
Then the wp-config.php file should not exist

When I run `wp config create {CORE_CONFIG_SETTINGS} --dbhost={SOCKET}`
Then the wp-config.php file should contain:
"""
Expand Down