From 6039df4c77edeef6d4fb68e2a5eab1358c456890 Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 12:18:08 +0200 Subject: [PATCH 1/8] run the test and see if updating the rails version helped --- spec/active_storage/rails_app_spec.rb | 3 --- spec/integration/active_storage/rails_app.rb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/spec/active_storage/rails_app_spec.rb b/spec/active_storage/rails_app_spec.rb index 26db2f2a..dacbaf81 100644 --- a/spec/active_storage/rails_app_spec.rb +++ b/spec/active_storage/rails_app_spec.rb @@ -5,12 +5,9 @@ def skip_reason 'Skipping because JRuby have randon failing issue' elsif RUBY_VERSION.to_f < 2.5 'Skipping because Rails testing script use Rails 6, who does not support Ruby bellow 2.5' - else - 'Skipping because this test randomly started failing for every version - mismatching default gem versions.' end end -# TODO: Investigate and fix this test describe 'Rails app with ActiveStorage and format-parser', skip: skip_reason do describe 'local hosting with ActiveStorage disk adapter' do it 'parse local file with format_parser' do diff --git a/spec/integration/active_storage/rails_app.rb b/spec/integration/active_storage/rails_app.rb index 9adc3372..e8f7c18f 100644 --- a/spec/integration/active_storage/rails_app.rb +++ b/spec/integration/active_storage/rails_app.rb @@ -5,7 +5,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem 'rails', '6.0.3' + gem 'rails', '6.0.6' gem 'sqlite3' gem 'format_parser', path: './' end From e628c662dea2b9f9257acc67599ec59b96b74ebe Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 14:30:21 +0200 Subject: [PATCH 2/8] see if adding rails as a dev dependency means the test has the correct dependencies available --- format_parser.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/format_parser.gemspec b/format_parser.gemspec index 5a71b49a..bf0ddc53 100644 --- a/format_parser.gemspec +++ b/format_parser.gemspec @@ -38,6 +38,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'measurometer' spec.add_development_dependency 'parallel_tests' + spec.add_development_dependency 'rails', '6.0.6' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' spec.add_development_dependency 'simplecov' From 194dad811d5284bbe6beab9efd2cb9e0160bdd60 Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 15:31:21 +0200 Subject: [PATCH 3/8] ensure tests run for every version to see if errors are different depending on ruby version --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9dda07bb..c8194fa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,6 +56,7 @@ jobs: test: name: Specs runs-on: ubuntu-latest + continue-on-error: true if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository strategy: matrix: From 918ccdc978164421a03d19b087f572ab65265ebc Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 16:05:20 +0200 Subject: [PATCH 4/8] see if it's a caching issue --- .github/workflows/main.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8194fa2..4a4deef5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,22 +74,22 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Gemfile Cache - uses: actions/cache@v3 - with: - path: Gemfile.lock - key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }} - restore-keys: | - ${{ runner.os }}-gemlock-${{ matrix.ruby }}- - - name: Bundle Cache - id: cache-gems - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }} - restore-keys: | - ${{ runner.os }}-gems-${{ matrix.ruby }}- - ${{ runner.os }}-gems- + # - name: Gemfile Cache + # uses: actions/cache@v3 + # with: + # path: Gemfile.lock + # key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }} + # restore-keys: | + # ${{ runner.os }}-gemlock-${{ matrix.ruby }}- + # - name: Bundle Cache + # id: cache-gems + # uses: actions/cache@v3 + # with: + # path: vendor/bundle + # key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }} + # restore-keys: | + # ${{ runner.os }}-gems-${{ matrix.ruby }}- + # ${{ runner.os }}-gems- - name: Bundle Install if: steps.cache-gems.outputs.cache-hit != 'true' run: bundle install --jobs 4 --retry 3 From 827a6921f1a3b6b4790f894bbc10356e8cb05a50 Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 16:14:47 +0200 Subject: [PATCH 5/8] prepending bundle exec may help the version issue --- spec/active_storage/rails_app_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/active_storage/rails_app_spec.rb b/spec/active_storage/rails_app_spec.rb index dacbaf81..8353ca11 100644 --- a/spec/active_storage/rails_app_spec.rb +++ b/spec/active_storage/rails_app_spec.rb @@ -12,7 +12,7 @@ def skip_reason describe 'local hosting with ActiveStorage disk adapter' do it 'parse local file with format_parser' do clean_env do - cmd = 'ruby spec/integration/active_storage/rails_app.rb' + cmd = 'bundle exec ruby spec/integration/active_storage/rails_app.rb' cmd_status = ruby_script_runner(cmd) expect(cmd_status[:stdout].last).to match(/1 runs, 3 assertions, 0 failures, 0 errors, 0 skips/) expect(cmd_status[:exitstatus]).to eq(0) From 03b6c7df6b874c4b06a2ea4a2c413dcf773cd1cd Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 16:19:46 +0200 Subject: [PATCH 6/8] version and caching seemed to make no difference --- .github/workflows/main.yml | 32 ++++++++++---------- format_parser.gemspec | 2 +- spec/integration/active_storage/rails_app.rb | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a4deef5..c8194fa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,22 +74,22 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - # - name: Gemfile Cache - # uses: actions/cache@v3 - # with: - # path: Gemfile.lock - # key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }} - # restore-keys: | - # ${{ runner.os }}-gemlock-${{ matrix.ruby }}- - # - name: Bundle Cache - # id: cache-gems - # uses: actions/cache@v3 - # with: - # path: vendor/bundle - # key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }} - # restore-keys: | - # ${{ runner.os }}-gems-${{ matrix.ruby }}- - # ${{ runner.os }}-gems- + - name: Gemfile Cache + uses: actions/cache@v3 + with: + path: Gemfile.lock + key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }} + restore-keys: | + ${{ runner.os }}-gemlock-${{ matrix.ruby }}- + - name: Bundle Cache + id: cache-gems + uses: actions/cache@v3 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }} + restore-keys: | + ${{ runner.os }}-gems-${{ matrix.ruby }}- + ${{ runner.os }}-gems- - name: Bundle Install if: steps.cache-gems.outputs.cache-hit != 'true' run: bundle install --jobs 4 --retry 3 diff --git a/format_parser.gemspec b/format_parser.gemspec index bf0ddc53..aad37c14 100644 --- a/format_parser.gemspec +++ b/format_parser.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'measurometer' spec.add_development_dependency 'parallel_tests' - spec.add_development_dependency 'rails', '6.0.6' + spec.add_development_dependency 'rails', '6.0.3' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' spec.add_development_dependency 'simplecov' diff --git a/spec/integration/active_storage/rails_app.rb b/spec/integration/active_storage/rails_app.rb index e8f7c18f..9adc3372 100644 --- a/spec/integration/active_storage/rails_app.rb +++ b/spec/integration/active_storage/rails_app.rb @@ -5,7 +5,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem 'rails', '6.0.6' + gem 'rails', '6.0.3' gem 'sqlite3' gem 'format_parser', path: './' end From fec99a9e6448198bec02d6de03295b82b8d79f0e Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Tue, 16 May 2023 16:22:49 +0200 Subject: [PATCH 7/8] using bundle exec made things worse --- spec/active_storage/rails_app_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/active_storage/rails_app_spec.rb b/spec/active_storage/rails_app_spec.rb index 8353ca11..dacbaf81 100644 --- a/spec/active_storage/rails_app_spec.rb +++ b/spec/active_storage/rails_app_spec.rb @@ -12,7 +12,7 @@ def skip_reason describe 'local hosting with ActiveStorage disk adapter' do it 'parse local file with format_parser' do clean_env do - cmd = 'bundle exec ruby spec/integration/active_storage/rails_app.rb' + cmd = 'ruby spec/integration/active_storage/rails_app.rb' cmd_status = ruby_script_runner(cmd) expect(cmd_status[:stdout].last).to match(/1 runs, 3 assertions, 0 failures, 0 errors, 0 skips/) expect(cmd_status[:exitstatus]).to eq(0) From b98456d1fb3d0381d835f2365971de61addef015 Mon Sep 17 00:00:00 2001 From: Ruben Wolff Date: Wed, 17 May 2023 10:11:57 +0200 Subject: [PATCH 8/8] undoing adding rails as a dev dependency as it seemed to not have made any difference --- format_parser.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/format_parser.gemspec b/format_parser.gemspec index aad37c14..5a71b49a 100644 --- a/format_parser.gemspec +++ b/format_parser.gemspec @@ -38,7 +38,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'measurometer' spec.add_development_dependency 'parallel_tests' - spec.add_development_dependency 'rails', '6.0.3' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' spec.add_development_dependency 'simplecov'