Skip to content

Commit

Permalink
Declare integration tests with less repetition (#2420)
Browse files Browse the repository at this point in the history
* Declare integration tests with less repetition
* Use 'not'
  • Loading branch information
dgutov authored Mar 24, 2024
1 parent 250200d commit f36011b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 37 deletions.
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
File renamed without changes.
File renamed without changes.

0 comments on commit f36011b

Please sign in to comment.