diff --git a/.github/workflows/macos-test.yaml b/.github/workflows/macos-test.yaml new file mode 100644 index 0000000000..7729f48e86 --- /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', '2.7'] + 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 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 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