Skip to content

Commit d969d24

Browse files
committed
Update CI to match instanceof and removed tmp dir
Drop the tmp-test-native path filter and smoke-script step (the dir was removed), and switch the inline native-availability checks from method_exists() to instanceof WP_MySQL_Native_Lexer.
1 parent 33b1fdc commit d969d24

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

.github/workflows/mysql-parser-extension-tests.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
paths:
66
- '.github/workflows/mysql-parser-extension-tests.yml'
77
- 'packages/mysql-on-sqlite/**'
8-
- 'tmp-test-native/**'
98
pull_request:
109
paths:
1110
- '.github/workflows/mysql-parser-extension-tests.yml'
1211
- 'packages/mysql-on-sqlite/**'
13-
- 'tmp-test-native/**'
1412
workflow_dispatch:
1513

1614
concurrency:
@@ -71,8 +69,8 @@ jobs:
7169
php -d extension="$GITHUB_WORKSPACE/packages/mysql-on-sqlite/ext/wp-mysql-parser/target/debug/libwp_mysql_parser.so" -r '
7270
require "src/load.php";
7371
$lexer = new WP_MySQL_Lexer( "SELECT ID, post_title FROM wp_posts WHERE ID IN (1, 2, 3)" );
74-
if ( ! method_exists( $lexer, "native_token_stream" ) ) {
75-
fwrite( STDERR, "Native token stream is not available.\n" );
72+
if ( ! ( $lexer instanceof WP_MySQL_Native_Lexer ) ) {
73+
fwrite( STDERR, "Native lexer is not available.\n" );
7674
exit( 1 );
7775
}
7876
$tokens = $lexer->remaining_tokens();
@@ -135,8 +133,8 @@ jobs:
135133
php -d extension="$GITHUB_WORKSPACE/packages/mysql-on-sqlite/ext/wp-mysql-parser/target/debug/libwp_mysql_parser.so" -r '
136134
require "packages/mysql-on-sqlite/src/load.php";
137135
$lexer = new WP_MySQL_Lexer( "SELECT 1" );
138-
if ( ! method_exists( $lexer, "native_token_stream" ) ) {
139-
fwrite( STDERR, "Native token stream is not available.\n" );
136+
if ( ! ( $lexer instanceof WP_MySQL_Native_Lexer ) ) {
137+
fwrite( STDERR, "Native lexer is not available.\n" );
140138
exit( 1 );
141139
}
142140
$driver = new WP_PDO_MySQL_On_SQLite( "mysql-on-sqlite:path=:memory:;dbname=wp;" );
@@ -151,6 +149,3 @@ jobs:
151149
exit( 1 );
152150
}
153151
'
154-
155-
- name: Run native SQLite facade smoke workload
156-
run: php -d extension="$GITHUB_WORKSPACE/packages/mysql-on-sqlite/ext/wp-mysql-parser/target/debug/libwp_mysql_parser.so" tmp-test-native/run-sqlite-facade-smoke.php

.github/workflows/wp-tests-phpunit-native-extension-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ cat > "$WP_DIR/native-verify-extension.php" <<'EOF'
116116
require '/var/www/src/wp-content/plugins/sqlite-database-integration/wp-includes/database/load.php';
117117
118118
$lexer = new WP_MySQL_Lexer( 'SELECT 1' );
119-
if ( ! method_exists( $lexer, 'native_token_stream' ) ) {
120-
fwrite( STDERR, "Native token stream is not available in the WordPress PHP test container.\n" );
119+
if ( ! ( $lexer instanceof WP_MySQL_Native_Lexer ) ) {
120+
fwrite( STDERR, "Native lexer is not available in the WordPress PHP test container.\n" );
121121
exit( 1 );
122122
}
123123

0 commit comments

Comments
 (0)