Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare integration tests with less repetition #2420

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 13 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ jobs:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
gemfile: [rack_2_0, rack_3_0, rails_6_0, rails_6_1, rails_7_0, rails_7_1]
integration_only: [false]
integration: [false]
include:
- ruby: '2.7'
gemfile: rack_1_0
- ruby: '2.7'
gemfile: multi_json
integration: multi_json
- ruby: '2.7'
gemfile: multi_xml
integration: multi_xml
- ruby: '2.7'
integration: rack_2_0
- ruby: '2.7'
integration: rack_3_0
- ruby: '3.3'
gemfile: no_dry_validation
integration_only: true
integration: no_dry_validation
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.integration || matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v4

Expand All @@ -49,35 +52,12 @@ jobs:
bundler-cache: true

- name: Run tests
if: ${{ matrix.integration_only == false }}
if: ${{ !matrix.integration }}
run: bundle exec rake spec

- name: Run tests (spec/integration/eager_load)
# rack_2_0.gemfile is equals to Gemfile
if: ${{ matrix.gemfile == 'rack_2_0' }}
run: bundle exec rspec spec/integration/eager_load

- name: Run tests (spec/integration/multi_json)
if: ${{ matrix.gemfile == 'multi_json' }}
run: bundle exec rspec spec/integration/multi_json

- name: Run tests (spec/integration/multi_xml)
if: ${{ matrix.gemfile == 'multi_xml' }}
run: bundle exec rspec spec/integration/multi_xml

- name: Run tests (spec/integration/rack/v2)
# rack_2_0.gemfile is equals to Gemfile
if: ${{ matrix.gemfile == 'rack_2_0' }}
run: bundle exec rspec spec/integration/rack/v2

- name: Run tests (spec/integration/rack/v3)
# rack_2_0.gemfile is equals to Gemfile
if: ${{ matrix.gemfile == 'rack_3_0' }}
run: bundle exec rspec spec/integration/rack/v3

- name: Run tests (spec/integration/no_dry_validation)
if: ${{ matrix.gemfile == 'no_dry_validation' }}
run: bundle exec rspec spec/integration/no_dry_validation
- name: Run integration tests (spec/integration/${{ matrix.integration }})
if: ${{ matrix.integration }}
run: bundle exec rspec spec/integration/${{ matrix.integration }}

- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
8 changes: 4 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ RSpec/FilePath:
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/integration/rack/v2/headers_spec.rb'
- 'spec/integration/rack/v3/headers_spec.rb'
- 'spec/integration/rack_2_0/headers_spec.rb'
- 'spec/integration/rack_3_0/headers_spec.rb'

# Offense count: 6
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
Expand Down Expand Up @@ -612,8 +612,8 @@ RSpec/SpecFilePathFormat:
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/integration/rack/v2/headers_spec.rb'
- 'spec/integration/rack/v3/headers_spec.rb'
- 'spec/integration/rack_2_0/headers_spec.rb'
- 'spec/integration/rack_3_0/headers_spec.rb'

# Offense count: 9
RSpec/StubbedMock:
Expand Down
Loading