From 8aa9fba626a94d719b884ca0c3ecc7d8bc157c24 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 9 Mar 2021 15:16:42 +0900 Subject: [PATCH 1/4] GitHub Actions: Add macOS CI Signed-off-by: Takuro Ashie --- .github/workflows/macos-test.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/macos-test.yaml diff --git a/.github/workflows/macos-test.yaml b/.github/workflows/macos-test.yaml new file mode 100644 index 0000000000..de8e0e5fb6 --- /dev/null +++ b/.github/workflows/macos-test.yaml @@ -0,0 +1,30 @@ +name: Testing on macOS + +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: ['head', '3.0', '2.7', '2.6', '2.5'] + os: [macos-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 dependencies + run: bundle install + - name: Run tests + run: bundle exec rake test From 5be55eb60c67192eaecdbe7bfc72c8cd5c66b97b Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 9 Mar 2021 17:16:47 +0900 Subject: [PATCH 2/4] Remove .travis.yml We've completely moved to GitHub Actions. CI for Some minor platforms has been dropped. * ppc64le * s390x Signed-off-by: Takuro Ashie --- .travis.yml | 77 ----------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d06dc90eb..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,77 +0,0 @@ -language: ruby -cache: bundler - -# script: bundle exec rake test TESTOPTS=-v - -# http://rubies.travis-ci.org/ -# See here for osx_image -> OSX versions: https://docs.travis-ci.com/user/languages/objective-c -matrix: - include: - - rvm: 2.4.9 - os: linux - env: USE_CAPNG=false - - rvm: 2.4.9 - os: linux-ppc64le - env: USE_CAPNG=false - - rvm: 2.5.7 - os: linux - env: USE_CAPNG=false - - rvm: 2.5.7 - os: linux - arch: s390x - dist: xenial - env: USE_CAPNG=false - - rvm: 2.6.5 - os: linux - env: USE_CAPNG=false - - rvm: 2.6.6 - os: linux - env: USE_CAPNG=true - - rvm: 2.7.0 - os: linux - env: USE_CAPNG=false - - rvm: ruby-head - os: linux - env: USE_CAPNG=false - - rvm: ruby-head - os: linux-ppc64le - env: USE_CAPNG=false - - rvm: 2.4.6 - os: osx - osx_image: xcode8.3 # OSX 10.12 - env: USE_CAPNG=false - - rvm: ruby-head - os: osx - osx_image: xcode8.3 # OSX 10.12 - env: USE_CAPNG=false - allow_failures: - - rvm: 2.4.6 - os: osx - osx_image: xcode8.3 - env: USE_CAPNG=false - - rvm: 2.5.7 - os: linux - arch: s390x - dist: xenial - env: USE_CAPNG=false - - rvm: ruby-head - env: USE_CAPNG=false - -branches: - only: - - master - -before_install: | - gem update --system=3.1.2 - if [[ x"${USE_CAPNG}" == "xtrue" ]]; then - echo 'gem "capng_c"' >> Gemfile.local - fi - -sudo: false -dist: trusty # for TLSv1.2 support - -addons: - apt: - packages: - - libgmp3-dev - - libcap-ng-dev From 51d6b9e36110d475ba276514cb61cd7529fc44c5 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 9 Mar 2021 18:38:19 +0900 Subject: [PATCH 3/4] Make sure to start I/O loop of a test on macOS Fix the following failure: Failure: test: can execute external command just once, and can terminate it forcedly when shutdown/terminate even if it ignore SIGTERM(ChildProcessTest): assert { lines2 > lines1 } | | | | | 0 | false 0 /Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:301:in `block (2 levels) in ' 298: @d.shutdown 299: sleep TEST_WAIT_INTERVAL_FOR_LOOP 300: lines2 = ary.size => 301: assert { lines2 > lines1 } 302: @d.close 303: 304: assert_nil((Process.waitpid(pid, Process::WNOHANG) rescue nil)) Signed-off-by: Takuro Ashie --- test/plugin_helper/test_child_process.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/plugin_helper/test_child_process.rb b/test/plugin_helper/test_child_process.rb index 8d14da5aee..e20b44b636 100644 --- a/test/plugin_helper/test_child_process.rb +++ b/test/plugin_helper/test_child_process.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require_relative '../helper' require 'fluent/plugin_helper/child_process' require 'fluent/plugin/base' @@ -269,10 +270,12 @@ def configure(conf) Timeout.timeout(TEST_DEADLOCK_TIMEOUT) do ran = false @d.child_process_execute(:t4, "ruby -e 'Signal.trap(:TERM, nil); while sleep 0.1; puts 1; STDOUT.flush rescue nil; end'", mode: [:read]) do |io| - m.lock - ran = true begin while line = io.readline + unless ran + m.lock + ran = true + end ary << line end rescue From 59ba008e2634556acbd3f300419764d2e4985f20 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 9 Mar 2021 23:34:08 +0900 Subject: [PATCH 4/4] CI: Reduce Ruby versions for macOS Signed-off-by: Takuro Ashie --- .github/workflows/macos-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-test.yaml b/.github/workflows/macos-test.yaml index de8e0e5fb6..7729f48e86 100644 --- a/.github/workflows/macos-test.yaml +++ b/.github/workflows/macos-test.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['head', '3.0', '2.7', '2.6', '2.5'] + ruby-version: ['head', '2.7'] os: [macos-latest] experimental: [true]