From eee000a81e40e88811639d465fb499f8ae95ae3e Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Fri, 25 Sep 2026 22:12:15 +0800 Subject: [PATCH 1/2] tests: find test directories at more than two levels deep list_products only globbed */Gemfile and */*/Gemfile, so samples nested three or more levels in were never picked up at all. That covers the cloud-sql activerecord samples, appengine/flexible and the per-language functions samples: 30 directories with tests that CI silently skipped. */**/Gemfile walks the whole tree and still leaves the top level Gemfile out, same as before. --- .toys/kokoro-ci.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.toys/kokoro-ci.rb b/.toys/kokoro-ci.rb index 7659846b6..aeaeebcfe 100644 --- a/.toys/kokoro-ci.rb +++ b/.toys/kokoro-ci.rb @@ -133,7 +133,7 @@ def list_products # Currently, we include the rails tests for the run/rails tutorial. omit_list = ["run/rails/test"] @products = [] - (Dir.glob("*/Gemfile") + Dir.glob("*/*/Gemfile")).each do |gemfile| + Dir.glob("*/**/Gemfile").each do |gemfile| dir = File.dirname gemfile if (File.directory?("#{dir}/test") && !omit_list.include?("#{dir}/test")) || (File.directory?("#{dir}/spec") && !omit_list.include?("#{dir}/spec")) || From 4cd33e102856274a09947ad3a9f4400d360dd893 Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Fri, 25 Sep 2026 22:12:38 +0800 Subject: [PATCH 2/2] tests: fix the cloud sql proxy checks The three checks in start_cloud_sql_services compared @products against "cloud-sql/mysql" and friends, but the products are the sample dirs, i.e. cloud-sql/mysql/activerecord, so none of them ever matched and no proxy was started for those tests. The SQL Server one also tested for postgres. Match on the directory prefix instead, and test for the sqlserver product in the sqlserver branch. --- .toys/kokoro-ci.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.toys/kokoro-ci.rb b/.toys/kokoro-ci.rb index aeaeebcfe..4aecaec19 100644 --- a/.toys/kokoro-ci.rb +++ b/.toys/kokoro-ci.rb @@ -208,7 +208,7 @@ def start_app_engine_services # Launch cloud sql proxy instances for cloud-sql tests # def start_cloud_sql_services - if @products.include? "cloud-sql/mysql" + if tests_product? "cloud-sql/mysql" puts "Starting Cloud SQL Proxy for MySQL", :bold connection_name = assert_env "MYSQL_INSTANCE_CONNECTION_NAME" process = exec ["/bin/cloud_sql_proxy", @@ -218,7 +218,7 @@ def start_cloud_sql_services ENV["MYSQL_CLOUD_SQL_PROXY_PROCESS_ID"] = process.pid.to_s @kill_on_cleanup << process end - if @products.include? "cloud-sql/postgres" + if tests_product? "cloud-sql/postgres" puts "Starting Cloud SQL Proxy for Postgres", :bold connection_name = assert_env "POSTGRES_INSTANCE_CONNECTION_NAME" process = exec ["/bin/cloud_sql_proxy", @@ -228,7 +228,7 @@ def start_cloud_sql_services ENV["POSTGRES_CLOUD_SQL_PROXY_PROCESS_ID"] = process.pid.to_s @kill_on_cleanup << process end - if @products.include? "cloud-sql/postgres" + if tests_product? "cloud-sql/sqlserver" puts "Starting Cloud SQL Proxy for SQL Server", :bold connection_name = assert_env "SQLSERVER_INSTANCE_CONNECTION_NAME" process = exec ["/bin/cloud_sql_proxy", @@ -369,6 +369,13 @@ def gac_path @gac_path ||= ENV["GOOGLE_APPLICATION_CREDENTIALS"] end +# Products are the sample directories themselves, but samples can also be +# nested underneath a product (for example cloud-sql/mysql/activerecord under +# cloud-sql/mysql), so match on the directory prefix rather than the exact name. +def tests_product? name + @products.any? { |dir| dir == name || dir.start_with?("#{name}/") } +end + def presubmit? unless defined? @is_presubmit @is_presubmit = (/system-tests/ =~ assert_env("KOKORO_BUILD_ARTIFACTS_SUBDIR")).nil?