|
6 | 6 |
|
7 | 7 | require __DIR__ . '/functions.php'; |
8 | 8 |
|
9 | | -// Check required environment variables |
| 9 | +// Check required environment variables. |
10 | 10 | check_required_env(); |
11 | 11 |
|
12 | | -// Bring some environment variables into scope |
| 12 | +// Bring some environment variables into scope. |
13 | 13 | $WPT_PREPARE_DIR = getenv( 'WPT_PREPARE_DIR' ); |
14 | 14 | $WPT_SSH_CONNECT = getenv( 'WPT_SSH_CONNECT' ); |
15 | 15 | $WPT_SSH_OPTIONS = getenv( 'WPT_SSH_OPTIONS' ) ? : '-o StrictHostKeyChecking=no'; |
16 | 16 | $WPT_TEST_DIR = getenv( 'WPT_TEST_DIR' ); |
17 | 17 | $WPT_PHP_EXECUTABLE = getenv( 'WPT_PHP_EXECUTABLE') ? : 'php'; |
18 | 18 |
|
19 | | -// Set the ssh private key if it's set |
| 19 | +// Set the ssh private key if it's set. |
20 | 20 | $WPT_SSH_PRIVATE_KEY_BASE64 = getenv( 'WPT_SSH_PRIVATE_KEY_BASE64' ); |
21 | 21 | if ( ! empty( $WPT_SSH_PRIVATE_KEY_BASE64 ) ) { |
22 | 22 | log_message( 'Securely extracting WPT_SSH_PRIVATE_KEY_BASE64 into ~/.ssh/id_rsa' ); |
|
27 | 27 | ) ); |
28 | 28 | } |
29 | 29 |
|
30 | | -// Create the prepation directory and fetch corresponding files |
| 30 | +// Create the preparation directory and fetch corresponding files |
31 | 31 | perform_operations( array( |
32 | 32 | 'mkdir -p ' . escapeshellarg( $WPT_PREPARE_DIR ), |
33 | 33 | 'git clone --depth=1 https://github.com/WordPress/wordpress-develop.git ' . escapeshellarg( $WPT_PREPARE_DIR ), |
|
37 | 37 | 'cd ' . escapeshellarg( $WPT_PREPARE_DIR ) . '; npm install && grunt build', |
38 | 38 | ) ); |
39 | 39 |
|
40 | | -// Replace variables in the wp-config.php file |
| 40 | +// Replace variables in the wp-config.php file. |
41 | 41 | log_message( 'Replacing variables in wp-tests-config.php' ); |
42 | 42 | $contents = file_get_contents( $WPT_PREPARE_DIR . '/wp-tests-config-sample.php' ); |
43 | | -// Log system information to same directory as test run log |
| 43 | +// Log system information to same directory as test run log. |
44 | 44 | $system_logger = <<<EOT |
45 | 45 | // Create the log directory to store test results |
46 | 46 | if ( ! is_dir( __DIR__ . '/tests/phpunit/build/logs/' ) ) { |
|
103 | 103 | $contents = str_replace( array_keys( $search_replace ), array_values( $search_replace ), $contents ); |
104 | 104 | file_put_contents( $WPT_PREPARE_DIR . '/wp-tests-config.php', $contents ); |
105 | 105 |
|
106 | | -// Deliver all files to test environment |
| 106 | +// Deliver all files to test environment. |
107 | 107 | if ( ! empty( $WPT_SSH_CONNECT ) ) { |
108 | 108 | perform_operations( array( |
109 | 109 | 'rsync -rv --exclude=".git/" -e "ssh ' . $WPT_SSH_OPTIONS . '" ' . escapeshellarg( trailingslashit( $WPT_PREPARE_DIR ) ) . ' ' . escapeshellarg( $WPT_SSH_CONNECT . ':' . $WPT_TEST_DIR ), |
|
0 commit comments