File tree Expand file tree Collapse file tree
integrations/query-monitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : WordPress End-to-end Tests
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+
9+ jobs :
10+ test :
11+ name : WordPress End-to-end Tests
12+ runs-on : ubuntu-latest
13+ timeout-minutes : 20
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+
22+ - name : Set UID and GID for PHP in WordPress images
23+ run : |
24+ echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
25+ echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
26+
27+ - name : Setup WordPress test environment
28+ run : composer run wp-setup
29+
30+ - name : Start WordPress test environment
31+ run : composer run wp-test-start
32+
33+ - name : Run WordPress end-to-end tests
34+ run : composer run wp-test-e2e
35+
36+ - name : Stop Docker containers
37+ if : always()
38+ run : composer run wp-test-clean
Original file line number Diff line number Diff line change 5252 "wp-test-php" : [
5353 " rm -rf wordpress/src/wp-content/database && npm --prefix wordpress run test:php --"
5454 ],
55+ "wp-test-e2e" : [
56+ " npm --prefix wordpress run test:e2e --"
57+ ],
5558 "wp-test-clean" : [
5659 " npm --prefix wordpress run env:clean"
5760 ]
Original file line number Diff line number Diff line change 6969
7070$ query_monitor_active = false ;
7171try {
72+ $ show_errors = $ wpdb ->hide_errors ();
73+
7274 $ value = $ wpdb ->get_row (
7375 $ wpdb ->prepare (
7476 "SELECT option_value FROM $ wpdb ->options WHERE option_name = %s LIMIT 1 " ,
7577 'active_plugins '
7678 )
7779 );
80+
81+ $ wpdb ->show_errors ( $ show_errors );
82+
7883 /**
7984 * $value may be null during WordPress Playground multisite setup.
8085 * @see https://github.com/WordPress/sqlite-database-integration/pull/219.
Original file line number Diff line number Diff line change @@ -65,3 +65,9 @@ sed -i.bak "s#class WpdbExposedMethodsForTesting extends wpdb {#class WpdbExpose
6565# 6. Install dependencies.
6666echo " Installing dependencies..."
6767npm --prefix " $WP_DIR " install
68+ npm --prefix " $WP_DIR " run build:dev
69+
70+ # 7. Add plugins for E2E tests.
71+ echo " Adding plugins for E2E tests..."
72+ npm --prefix " $WP_DIR " run env:cli -- plugin install gutenberg
73+ npm --prefix " $WP_DIR " run env:cli -- plugin install query-monitor
You can’t perform that action at this time.
0 commit comments