Skip to content

Commit

Permalink
Add a test which covers a mix of groups and ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn committed Jul 31, 2023
1 parent 6871b37 commit e281903
Show file tree
Hide file tree
Showing 20 changed files with 5,315 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@

context "when the snapshot is only grouping minor- and patch-level changes", :vcr do
let(:job_definition) do
job_definition_fixture("bundler/version_updates/group_update_all_semvar_grouping")
job_definition_fixture("bundler/version_updates/group_update_all_semver_grouping")
end

let(:dependency_files) do
Expand All @@ -288,8 +288,8 @@
an_object_having_attributes(
dependency_group: an_object_having_attributes(name: "small-bumps"),
updated_dependencies: [
an_object_having_attributes(name: "rack", version: "2.2.7", previous_version: "2.1.4.3"),
an_object_having_attributes(name: "rubocop", version: "0.93.1", previous_version: "0.76.0")
an_object_having_attributes(name: "rack", version: "2.2.7", previous_version: "2.1.3"),
an_object_having_attributes(name: "rubocop", version: "0.93.1", previous_version: "0.75.0")
],
updated_dependency_files: updated_group_dependency_files
),
Expand All @@ -300,7 +300,7 @@
an_object_having_attributes(
dependency_group: nil,
updated_dependencies: [
an_object_having_attributes(name: "rack", version: "3.0.8", previous_version: "2.1.4.3")
an_object_having_attributes(name: "rack", version: "3.0.8", previous_version: "2.1.3")
],
updated_dependency_files: updated_rack_major_files
),
Expand All @@ -311,7 +311,7 @@
an_object_having_attributes(
dependency_group: nil,
updated_dependencies: [
an_object_having_attributes(name: "rubocop", version: "1.54.2", previous_version: "0.76.0")
an_object_having_attributes(name: "rubocop", version: "1.54.2", previous_version: "0.75.0")
],
updated_dependency_files: updated_rubocop_major_files
),
Expand All @@ -322,6 +322,54 @@
end
end

context "when the snapshot is only grouping patch-level changes and major changes are ignored", :vcr do
let(:job_definition) do
job_definition_fixture("bundler/version_updates/group_update_all_semver_grouping_with_global_ignores")
end

let(:dependency_files) do
original_bundler_files(fixture: "bundler_grouped_by_types")
end

it "creates a pull request for patches and individual PRs for minor-level changes" do
expect(mock_service).to receive(:create_pull_request).with(
an_object_having_attributes(
dependency_group: an_object_having_attributes(name: "patches"),
updated_dependencies: [
an_object_having_attributes(name: "rack", version: "2.1.4.3", previous_version: "2.1.3"),
an_object_having_attributes(name: "rubocop", version: "0.75.1", previous_version: "0.75.0")
],
updated_dependency_files: anything
),
"mock-sha"
)

expect(mock_service).to receive(:create_pull_request).with(
an_object_having_attributes(
dependency_group: nil,
updated_dependencies: [
an_object_having_attributes(name: "rack", version: "2.2.7", previous_version: "2.1.3")
],
updated_dependency_files: anything
),
"mock-sha"
)

expect(mock_service).to receive(:create_pull_request).with(
an_object_having_attributes(
dependency_group: nil,
updated_dependencies: [
an_object_having_attributes(name: "rubocop", version: "0.93.1", previous_version: "0.75.0")
],
updated_dependency_files: anything
),
"mock-sha"
)

group_update_all.perform
end
end

context "when a pull request already exists for a group" do
let(:job_definition) do
job_definition_fixture("bundler/version_updates/group_update_all_with_existing_pr")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

source "https://rubygems.org"

gem "rack", "~> 2.1.4"
gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.76.0"
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ GEM
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.4.3)
rack (2.1.3)
rainbow (3.1.1)
rubocop (0.76.0)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
Expand All @@ -27,8 +27,8 @@ PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.4)
rubocop (~> 0.76.0)
rack (~> 2.1.3)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rack", "~> 2.1.4"
gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.4.3)
rack (2.1.3)
rainbow (3.1.1)
regexp_parser (2.8.1)
rexml (3.2.6)
Expand All @@ -36,7 +36,7 @@ PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.4)
rack (~> 2.1.3)
rubocop (~> 1.54.2)
toml-rb (~> 2.2.0)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
citrus (3.0.2)
jaro_winkler (1.5.6)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.3)
rainbow (3.1.1)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.13.0)
toml-rb (2.2.0)
citrus (~> 3.0, > 3.0)
unicode-display_width (1.6.1)

PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.3)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
2.4.14
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ gem "rack", "~> 3.0.8"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.76.0"
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GEM
racc (1.7.1)
rack (3.0.8)
rainbow (3.1.1)
rubocop (0.76.0)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
Expand All @@ -28,7 +28,7 @@ PLATFORMS

DEPENDENCIES
rack (~> 3.0.8)
rubocop (~> 0.76.0)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ gem "rack", "~> 3.0.8"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.76.0"
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GEM
racc (1.7.1)
rack (3.0.8)
rainbow (3.1.1)
rubocop (0.76.0)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
Expand All @@ -28,7 +28,7 @@ PLATFORMS

DEPENDENCIES
rack (~> 3.0.8)
rubocop (~> 0.76.0)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
citrus (3.0.2)
jaro_winkler (1.5.6)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.3)
rainbow (3.1.1)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.13.0)
toml-rb (2.2.0)
citrus (~> 3.0, > 3.0)
unicode-display_width (1.6.1)

PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.3)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
2.4.14
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rack", "~> 2.1.4"
gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.4.3)
rack (2.1.3)
rainbow (3.1.1)
regexp_parser (2.8.1)
rexml (3.2.5)
Expand All @@ -36,7 +36,7 @@ PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.4)
rack (~> 2.1.3)
rubocop (~> 1.54.2)
toml-rb (~> 2.2.0)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rack", "~> 2.1.3"
gem "toml-rb", "~> 2.2.0"

group :development do
gem "rubocop", "~> 0.75.0"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
citrus (3.0.2)
jaro_winkler (1.5.6)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
racc (1.7.1)
rack (2.1.3)
rainbow (3.1.1)
rubocop (0.75.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.13.0)
toml-rb (2.2.0)
citrus (~> 3.0, > 3.0)
unicode-display_width (1.6.1)

PLATFORMS
ruby

DEPENDENCIES
rack (~> 2.1.3)
rubocop (~> 0.75.0)
toml-rb (~> 2.2.0)

BUNDLED WITH
2.4.14
Loading

0 comments on commit e281903

Please sign in to comment.