Skip to content

Commit

Permalink
Merge pull request #3281 from ashie/tweak-github-actions
Browse files Browse the repository at this point in the history
Tweak GitHub Actions and Remove AppVeyor
  • Loading branch information
ashie committed Mar 5, 2021
2 parents 4437fd9 + e4c1a60 commit 3b88465
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 38 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/linux-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Testing on Ubuntu

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
ruby-version: ['3.0', '2.7', '2.6', '2.5']
os: [ubuntu-latest]
experimental: [false]
include:
- ruby-version: head
os: ubuntu-latest
experimental: true

name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install addons
run: sudo apt-get install libgmp3-dev libcap-ng-dev
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Testing on Windows

on:
push:
Expand All @@ -8,22 +8,23 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
ruby-version: [2.7, 2.6, 2.5]
ruby-version: ['3.0', '2.7', '2.6', '2.5']
os:
- windows-latest

name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install addons
run: sudo apt-get install libgmp3-dev libcap-ng-dev
- name: Install dependencies
run: bundle install
run: ridk exec bundle install
- name: Run tests
run: bundle exec rake test TESTOPTS=-v
31 changes: 0 additions & 31 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion test/config/test_configurable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ def assert_secret_param(key, value)
@example = ConfigurableSpec::ExampleWithSkipAccessor.new
@example.configure(config_element('ROOT'))
assert_equal 'example7', @example.instance_variable_get(:@name)
assert_raise NoMethodError.new("undefined method `name' for #{@example}") do
assert_raise NoMethodError do
@example.name
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/plugin/out_forward/test_connection_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class ConnectionManager < Test::Unit::TestCase

sub_test_case 'when socket_cache exists' do
test 'calls connect_keepalive' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
mock(cache).checkin('sock').never

Expand All @@ -99,6 +101,8 @@ class ConnectionManager < Test::Unit::TestCase
end

test 'calls connect_keepalive and closes socket with block' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
mock(cache).checkin('sock').once

Expand All @@ -118,6 +122,8 @@ class ConnectionManager < Test::Unit::TestCase
end

test 'does not call dec_ref when ack is passed' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

cache = Fluent::Plugin::ForwardOutput::SocketCache.new(10, $log)
mock(cache).checkin('sock').never
sock = 'sock'
Expand Down
6 changes: 6 additions & 0 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,8 @@ def create_target_input_driver(response_stub: nil, disconnect: false, conf: TARG
end

test 'when out_forward has @id' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

# cancel https://github.com/fluent/fluentd/blob/077508ac817b7637307434d0c978d7cdc3d1c534/lib/fluent/plugin_id.rb#L43-L53
# it always return true in test
mock.proxy(Fluent::Plugin).new_sd(:static, anything) { |v|
Expand Down Expand Up @@ -1137,6 +1139,8 @@ def plugin_id_for_test?
end

test 'Create new connection per send_data' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

target_input_driver = create_target_input_driver(conf: TARGET_CONFIG)
output_conf = CONFIG
d = create_driver(output_conf)
Expand Down Expand Up @@ -1175,6 +1179,8 @@ def plugin_id_for_test?

sub_test_case 'keepalive' do
test 'Do not create connection per send_data' do
omit "Proxy of RR doesn't support kwargs of Ruby 3 yet" if RUBY_VERSION.split('.')[0].to_i >= 3

target_input_driver = create_target_input_driver(conf: TARGET_CONFIG)
output_conf = CONFIG + %[
keepalive true
Expand Down

0 comments on commit 3b88465

Please sign in to comment.