From d1bf8b3001371279ed55b62da3e0cf5d4f859deb Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 11:43:35 +0900 Subject: [PATCH 1/6] ci: let bundler-cache: true to install gems Signed-off-by: Kentaro Hayashi --- .github/workflows/linux.yml | 3 +-- .github/workflows/macos.yml | 3 +-- .github/workflows/windows.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index be5dfa4..40f03a1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -17,10 +17,9 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: unit testing env: CI: true run: | - gem install bundler rake - bundle install --jobs 4 --retry 3 bundle exec rake test diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4a50081..b4c5a10 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,10 +17,9 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: unit testing env: CI: true run: | - gem install bundler rake - bundle install --jobs 4 --retry 3 bundle exec rake test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 41c5582..f27ef76 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -17,10 +17,9 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: unit testing env: CI: true run: | - gem install bundler rake - bundle install --jobs 4 --retry 3 bundle exec rake test From 73715bc9fcdf89e7b9aaa9d42dbf65cb5bb9643c Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 11:45:15 +0900 Subject: [PATCH 2/6] ci: drop older than CRuby 2.7 It is hard to keep maintaining EOL versions for older platforms. Signed-off-by: Kentaro Hayashi --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 40f03a1..dcac266 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.5', '2.6', '2.7' ] + ruby: [ '2.7' ] os: - ubuntu-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b4c5a10..bbfdfda 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.5', '2.6', '2.7' ] + ruby: [ '2.7' ] os: - macOS-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f27ef76..716552d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.5', '2.6', '2.7' ] + ruby: [ '2.7' ] os: - windows-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} From ada4721ecb7904158a4bf993dc33eca619bdac65 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 11:47:04 +0900 Subject: [PATCH 3/6] ci: add CRuby 3.0 or later Signed-off-by: Kentaro Hayashi --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dcac266..1abea83 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.7' ] + ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ] os: - ubuntu-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bbfdfda..c3c7afd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.7' ] + ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ] os: - macOS-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 716552d..b3da332 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '2.7' ] + ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ] os: - windows-latest name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }} From 1f92ae3d7ab6331d59be97a28350e747db445a1f Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 11:54:18 +0900 Subject: [PATCH 4/6] ci: avoid conflicting name Signed-off-by: Kentaro Hayashi --- test/plugin/test_out_irc.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/plugin/test_out_irc.rb b/test/plugin/test_out_irc.rb index fa7b854..eca28e7 100644 --- a/test/plugin/test_out_irc.rb +++ b/test/plugin/test_out_irc.rb @@ -26,7 +26,7 @@ def config( command: COMMAND.to_s, command_keys: nil ) - config = %[ + data = %[ type irc host localhost port #{port} @@ -44,8 +44,8 @@ def config( send_queue_limit 10 send_interval 0.5 ] - config += %[command_keys #{command_keys}] if command_keys - config + data += %[command_keys #{command_keys}] if command_keys + data end From 2a8688d7bb86cec00160a7f943498cc83b94d99a Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 14:29:24 +0900 Subject: [PATCH 5/6] ci: simplify with hash Since Ruby 3, the behavior of auto-conversion about keyword argument was changed, so unify to hash argument for simplicity because .merge was used for config in test code. Before: config({port: ...}) config(command: ...) After: config({port: ...}) Signed-off-by: Kentaro Hayashi --- test/plugin/test_out_irc.rb | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/test/plugin/test_out_irc.rb b/test/plugin/test_out_irc.rb index eca28e7..e3a4951 100644 --- a/test/plugin/test_out_irc.rb +++ b/test/plugin/test_out_irc.rb @@ -19,23 +19,17 @@ def setup Fluent::Engine.now = Time.now end - def config( - port: PORT, - channel: CHANNEL, - channel_keys: "", - command: COMMAND.to_s, - command_keys: nil - ) + def config(options = {}) data = %[ type irc host localhost - port #{port} - channel #{channel} - channel_keys #{channel_keys} + port #{options.fetch(:port, PORT)} + channel #{options.fetch(:channel, CHANNEL)} + channel_keys #{options.fetch(:channel_keys, "")} nick #{NICK} user #{USER} real #{REAL} - command #{command} + command #{options.fetch(:command, COMMAND.to_s)} message #{MESSAGE} out_keys tag,time,msg time_key time @@ -44,6 +38,7 @@ def config( send_queue_limit 10 send_interval 0.5 ] + command_keys = options.fetch(:command_keys, nil) data += %[command_keys #{command_keys}] if command_keys data end @@ -73,25 +68,25 @@ def test_configure end def test_configure_channel_keys - d = create_driver(config(channel:"%s", channel_keys:"channel")) + d = create_driver(config({channel:"%s", channel_keys:"channel"})) assert_equal "#%s", d.instance.channel assert_equal ["channel"], d.instance.channel_keys end def test_configure_command_keys - d = create_driver(config(command:"%s", command_keys:"command")) + d = create_driver(config({command:"%s", command_keys:"command"})) assert_equal "%s", d.instance.command assert_equal ["command"], d.instance.command_keys end def test_configure_command assert_raise Fluent::ConfigError do - create_driver(config(command: 'foo')) + create_driver(config({command: 'foo'})) end - assert_nothing_raised { create_driver(config(command: 'priv_msg')) } - assert_nothing_raised { create_driver(config(command: 'privmsg')) } - assert_nothing_raised { create_driver(config(command: 'notice')) } + assert_nothing_raised { create_driver(config({command: 'priv_msg'})) } + assert_nothing_raised { create_driver(config({command: 'privmsg'})) } + assert_nothing_raised { create_driver(config({command: 'notice'})) } end def test_emit From 7ed910eaa2a8b5eb92e2b371ed7badd6a2f9c2e4 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 6 Mar 2026 14:45:40 +0900 Subject: [PATCH 6/6] ci: fix encoding mismatch Signed-off-by: Kentaro Hayashi --- test/plugin/test_out_irc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin/test_out_irc.rb b/test/plugin/test_out_irc.rb index e3a4951..16fd4c7 100644 --- a/test/plugin/test_out_irc.rb +++ b/test/plugin/test_out_irc.rb @@ -106,7 +106,7 @@ def test_emit s = IRCParser.parse(socket.gets) m[s.class.to_sym] = s - s = IRCParser.parse(socket.gets) + s = IRCParser.parse(socket.gets&.force_encoding("utf-8")) m[s.class.to_sym] = s assert_equal ["##{CHANNEL}"], m[:join].channels