Skip to content

Commit 33d55c4

Browse files
committed
Use more descriptive file name for MySQL test queries
1 parent afc70bb commit 33d55c4

6 files changed

+7
-7
lines changed

tests/mysql/WP_MySQL_Server_Suite_Lexer_Tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class WP_MySQL_Server_Suite_Lexer_Tests extends TestCase {
1414
* is too large for PHPUnit to run a test per query, causing memory errors.
1515
*/
1616
public function test_tokenize_mysql_test_suite(): void {
17-
$path = __DIR__ . '/data/queries.csv';
17+
$path = __DIR__ . '/data/mysql-server-tests-queries.csv';
1818
$handle = @fopen( $path, 'r' );
1919
if ( false === $handle ) {
2020
$this->fail( "Failed to open file '$path'." );

tests/mysql/WP_MySQL_Server_Suite_Parser_Tests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Parser tests using the full MySQL server test suite.
77
*/
88
class WP_MySQL_Server_Suite_Parser_Tests extends TestCase {
9-
const TEST_DATA_PATH = __DIR__ . '/data/queries.csv';
9+
const TEST_DATA_PATH = __DIR__ . '/data/mysql-server-tests-queries.csv';
1010
const GRAMMAR_PATH = __DIR__ . '/../../wp-includes/mysql/mysql-grammar.php';
1111

1212
/**
@@ -67,7 +67,7 @@ public function test_parse_mysql_test_suite( array $batch ): void {
6767
}
6868

6969
public function data_parse_mysql_test_suite(): Generator {
70-
$path = __DIR__ . '/data/queries.csv';
70+
$path = __DIR__ . '/data/mysql-server-tests-queries.csv';
7171
$handle = @fopen( $path, 'r' );
7272
if ( false === $handle ) {
7373
$this->fail( "Failed to open file '$path'." );
File renamed without changes.

tests/tools/mysql-extract-queries.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* This script scans MySQL server test files, extracts SQL queries from them,
5-
* and saves the queries in a CSV file under "tests/mysql/data/queries.csv".
5+
* and saves them as CSV under "tests/mysql/data/mysql-server-tests-queries.csv".
66
*
77
* The test files first need to be downloaded from the MySQL server repository.
88
* See the "mysql-download-tests.sh" script for more details.
@@ -25,7 +25,7 @@
2525

2626
// Paths:
2727
$data_dir = __DIR__ . '/../mysql/data';
28-
$query_file = $data_dir . '/queries.csv';
28+
$query_file = $data_dir . '/mysql-server-tests-queries.csv';
2929

3030
// Comments and other prefixes to skip:
3131
$prefixes = array(

tests/tools/run-lexer-benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function ( $severity, $message, $file, $line ) {
1616
require_once __DIR__ . '/../../wp-includes/mysql/class-wp-mysql-lexer.php';
1717

1818
// Load the queries.
19-
$handle = fopen( __DIR__ . '/../mysql/data/queries.csv', 'r' );
19+
$handle = fopen( __DIR__ . '/../mysql/data/mysql-server-tests-queries.csv', 'r' );
2020
$records = array();
2121
while ( ( $record = fgetcsv( $handle ) ) !== false ) {
2222
$records[] = $record;

tests/tools/run-parser-benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function getStats( $total, $failures, $exceptions ) {
3737

3838
// Load the queries.
3939
$data_dir = __DIR__ . '/../mysql/data';
40-
$handle = fopen( "$data_dir/queries.csv", 'r' );
40+
$handle = fopen( "$data_dir/mysql-server-tests-queries.csv", 'r' );
4141
$records = array();
4242
while ( ( $record = fgetcsv( $handle ) ) !== false ) {
4343
$records[] = $record;

0 commit comments

Comments
 (0)