From a24b5804ef67187fd1fd4b548eafbb1efc22bc78 Mon Sep 17 00:00:00 2001 From: Masaki Suketa Date: Thu, 12 Mar 2026 21:03:48 +0900 Subject: [PATCH] skip ScalarFunction test on Windows platform. --- test/duckdb_test/scalar_function_test.rb | 54 +++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/test/duckdb_test/scalar_function_test.rb b/test/duckdb_test/scalar_function_test.rb index 2cb611a3..aa7f07ee 100644 --- a/test/duckdb_test/scalar_function_test.rb +++ b/test/duckdb_test/scalar_function_test.rb @@ -55,6 +55,8 @@ def test_set_function end def test_register_scalar_function + skip 'Scalar functions with Ruby test' if Gem.win_platform? + # Scalar functions with Ruby callbacks require single-threaded execution @con.execute('SET threads=1') @@ -117,6 +119,8 @@ def test_add_parameter_raises_error_for_invalid_argument end def test_scalar_function_with_one_parameter # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value INTEGER)') @con.execute('INSERT INTO test_table VALUES (5), (10), (15)') @@ -133,7 +137,9 @@ def test_scalar_function_with_one_parameter # rubocop:disable Metrics/MethodLeng assert_equal [[10], [20], [30]], result.to_a end - def test_scalar_function_with_two_parameters # rubocop:disable Metrics/MethodLength + def test_scalar_function_with_two_parameters # rubocop:disable Metrics/MethodLength, Metrics/AbcSize + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (a INTEGER, b INTEGER)') @con.execute('INSERT INTO test_table VALUES (5, 3), (10, 2), (15, 4)') @@ -152,6 +158,8 @@ def test_scalar_function_with_two_parameters # rubocop:disable Metrics/MethodLen end def test_scalar_function_with_null_input # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value INTEGER)') @con.execute('INSERT INTO test_table VALUES (5), (NULL), (15)') @@ -169,6 +177,8 @@ def test_scalar_function_with_null_input # rubocop:disable Metrics/MethodLength end def test_scalar_function_bigint_return_type # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value BIGINT)') @con.execute('INSERT INTO test_table VALUES (9223372036854775807)') # Max int64 @@ -186,6 +196,8 @@ def test_scalar_function_bigint_return_type # rubocop:disable Metrics/MethodLeng end def test_scalar_function_double_return_type # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value DOUBLE)') @con.execute('INSERT INTO test_table VALUES (3.14159)') @@ -203,6 +215,8 @@ def test_scalar_function_double_return_type # rubocop:disable Metrics/MethodLeng end def test_scalar_function_boolean_return_type # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value INTEGER)') @con.execute('INSERT INTO test_table VALUES (5), (10), (15)') @@ -220,6 +234,8 @@ def test_scalar_function_boolean_return_type # rubocop:disable Metrics/MethodLen end def test_scalar_function_float_return_type # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value FLOAT)') @con.execute('INSERT INTO test_table VALUES (2.5)') @@ -237,6 +253,8 @@ def test_scalar_function_float_return_type # rubocop:disable Metrics/MethodLengt end def test_scalar_function_varchar_return_type # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (name VARCHAR)') @con.execute("INSERT INTO test_table VALUES ('Alice'), ('Bob')") @@ -254,6 +272,8 @@ def test_scalar_function_varchar_return_type # rubocop:disable Metrics/MethodLen end def test_scalar_function_blob_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (data BLOB)') @con.execute("INSERT INTO test_table VALUES ('\\x00\\x01\\x02\\x03'::BLOB), ('\\x00\\xAA\\xBB\\xCC'::BLOB)") @@ -274,6 +294,8 @@ def test_scalar_function_blob_return_type # rubocop:disable Metrics/AbcSize, Met end def test_scalar_function_timestamp_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (ts TIMESTAMP)') @con.execute("INSERT INTO test_table VALUES ('2024-01-15 10:30:00'), ('2024-12-25 23:59:59')") @@ -294,6 +316,8 @@ def test_scalar_function_timestamp_return_type # rubocop:disable Metrics/AbcSize end def test_scalar_function_date_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (d DATE)') @con.execute("INSERT INTO test_table VALUES ('2024-01-15'), ('2024-12-25')") @@ -314,6 +338,8 @@ def test_scalar_function_date_return_type # rubocop:disable Metrics/AbcSize, Met end def test_scalar_function_time_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (t TIME)') @con.execute("INSERT INTO test_table VALUES ('10:30:00'), ('23:59:59')") @@ -338,6 +364,8 @@ def test_scalar_function_time_return_type # rubocop:disable Metrics/AbcSize, Met end def test_scalar_function_smallint_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value SMALLINT)') @con.execute('INSERT INTO test_table VALUES (32767), (-32768), (1000)') @@ -359,6 +387,8 @@ def test_scalar_function_smallint_return_type # rubocop:disable Metrics/AbcSize, end def test_scalar_function_tinyint_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value TINYINT)') @con.execute('INSERT INTO test_table VALUES (100), (-50), (0)') @@ -380,6 +410,8 @@ def test_scalar_function_tinyint_return_type # rubocop:disable Metrics/AbcSize, end def test_scalar_function_utinyint_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value UTINYINT)') @con.execute('INSERT INTO test_table VALUES (255), (0), (100)') @@ -402,6 +434,8 @@ def test_scalar_function_utinyint_return_type # rubocop:disable Metrics/AbcSize, end def test_scalar_function_usmallint_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value USMALLINT)') @con.execute('INSERT INTO test_table VALUES (65535), (0), (1000)') @@ -423,6 +457,8 @@ def test_scalar_function_usmallint_return_type # rubocop:disable Metrics/AbcSize end def test_scalar_function_uinteger_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value UINTEGER)') @con.execute('INSERT INTO test_table VALUES (4294967200), (0), (1000000)') @@ -444,6 +480,8 @@ def test_scalar_function_uinteger_return_type # rubocop:disable Metrics/AbcSize, end def test_scalar_function_ubigint_return_type # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Minitest/MultipleAssertions + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') @con.execute('CREATE TABLE test_table (value UBIGINT)') @con.execute('INSERT INTO test_table VALUES (9223372036854775807), (0), (1000000000)') @@ -465,6 +503,8 @@ def test_scalar_function_ubigint_return_type # rubocop:disable Metrics/AbcSize, end def test_scalar_function_gc_safety # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') # Register function and immediately lose reference @@ -556,6 +596,8 @@ def test_gc_compaction_with_table_scan # rubocop:disable Metrics/AbcSize, Metric # Tests for ScalarFunction.create class method def test_create_with_single_parameter # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create( @@ -575,6 +617,8 @@ def test_create_with_single_parameter # rubocop:disable Metrics/MethodLength end def test_create_with_multiple_parameters # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create( @@ -594,6 +638,8 @@ def test_create_with_multiple_parameters # rubocop:disable Metrics/MethodLength end def test_create_with_no_parameters # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create( @@ -636,6 +682,8 @@ def test_create_rejects_both_parameter_type_and_parameter_types end def test_create_accepts_symbol_for_name + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create( @@ -651,6 +699,8 @@ def test_create_accepts_symbol_for_name end def test_create_accepts_string_for_name + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create( @@ -666,6 +716,8 @@ def test_create_accepts_string_for_name end def test_create_with_different_types # rubocop:disable Metrics/MethodLength + skip 'Scalar functions with Ruby test' if Gem.win_platform? + @con.execute('SET threads=1') sf = DuckDB::ScalarFunction.create(