gouteur 1.1.0 β 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +8 -5
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -8
- data/Gemfile.lock +74 -37
- data/README.md +24 -10
- data/Rakefile +1 -1
- data/lib/gouteur/bundle.rb +1 -1
- data/lib/gouteur/message.rb +2 -2
- data/lib/gouteur/repo.rb +16 -4
- data/lib/gouteur/version.rb +1 -1
- metadata +3 -7
- data/.github/workflows/lint.yml +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec10a96202fe527dacc5f4bf12342b15bd6f97e1ee34ea061ed09b9493185d56
|
|
4
|
+
data.tar.gz: df1daa88ea3074c2007573a76234c1db4e006e2d6c9994f65b585c070d739fd8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edfc25b8299250c7770d68745b17df443d5757a01234eae0d826efa6232a14faacc10ced6bceaf982a0a7749fcfd5e9cfe734bdd3bcee10cc8e9ae41e3523274
|
|
7
|
+
data.tar.gz: 4cedcee12cf24b8318567df163f7a9ebb6617124185564d0568dad4a11f180b6a81967e409ee1c642bc68557303f585f3c52100ac6e020a874d9e4b73cc62f18
|
data/.github/workflows/build.yml
CHANGED
|
@@ -8,10 +8,10 @@ jobs:
|
|
|
8
8
|
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
|
-
ruby: [ '
|
|
11
|
+
ruby: [ '3.5', '4.0' ]
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
15
|
- name: Set up Ruby ${{ matrix.ruby }}
|
|
16
16
|
uses: ruby/setup-ruby@v1
|
|
17
17
|
with:
|
|
@@ -21,8 +21,11 @@ jobs:
|
|
|
21
21
|
git config --global init.defaultBranch main
|
|
22
22
|
git config --global user.email "testuser@example.com"
|
|
23
23
|
git config --global user.name "Test User"
|
|
24
|
-
gem
|
|
24
|
+
gem update --system
|
|
25
|
+
gem install bundler -v 4.0.9
|
|
25
26
|
bundle install --jobs 4
|
|
26
|
-
- name:
|
|
27
|
+
- name: Build
|
|
27
28
|
run: |
|
|
28
|
-
bundle exec
|
|
29
|
+
bundle exec rake
|
|
30
|
+
- uses: codecov/codecov-action@v3
|
|
31
|
+
if: matrix.ruby == '4.0'
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
@@ -3,14 +3,12 @@ source 'https://rubygems.org'
|
|
|
3
3
|
# Specify your gem's dependencies in gouteur.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
+
gem 'debug'
|
|
7
|
+
gem 'example_repo', '0.1.0', path: './spec/gouteur/example_repo'
|
|
6
8
|
gem 'rake', '~> 13.0'
|
|
7
|
-
|
|
9
|
+
gem 'relaxed-rubocop'
|
|
8
10
|
gem 'rspec', '~> 3.0'
|
|
9
|
-
|
|
10
11
|
gem 'rubocop', '~> 1.7'
|
|
11
|
-
|
|
12
|
-
gem
|
|
13
|
-
|
|
14
|
-
gem 'example_repo', '0.1.0', path: './spec/gouteur/example_repo'
|
|
15
|
-
|
|
16
|
-
gem 'debug'
|
|
12
|
+
if RUBY_VERSION.to_f >= 3.0
|
|
13
|
+
gem "simplecov-cobertura"
|
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
|
@@ -11,52 +11,88 @@ PATH
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
ast (2.4.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
ast (2.4.3)
|
|
15
|
+
date (3.5.1)
|
|
16
|
+
debug (1.11.1)
|
|
17
|
+
irb (~> 1.10)
|
|
18
|
+
reline (>= 0.3.8)
|
|
19
|
+
diff-lcs (1.6.2)
|
|
20
|
+
docile (1.4.1)
|
|
21
|
+
erb (6.0.2)
|
|
22
|
+
io-console (0.8.2)
|
|
23
|
+
irb (1.17.0)
|
|
24
|
+
pp (>= 0.6.0)
|
|
25
|
+
prism (>= 1.3.0)
|
|
26
|
+
rdoc (>= 4.0.0)
|
|
27
|
+
reline (>= 0.4.2)
|
|
28
|
+
json (2.19.3)
|
|
29
|
+
language_server-protocol (3.17.0.5)
|
|
30
|
+
lint_roller (1.1.0)
|
|
31
|
+
parallel (1.28.0)
|
|
32
|
+
parser (3.3.11.1)
|
|
25
33
|
ast (~> 2.4.1)
|
|
34
|
+
racc
|
|
35
|
+
pp (0.6.3)
|
|
36
|
+
prettyprint
|
|
37
|
+
prettyprint (0.2.0)
|
|
38
|
+
prism (1.9.0)
|
|
39
|
+
psych (5.3.1)
|
|
40
|
+
date
|
|
41
|
+
stringio
|
|
42
|
+
racc (1.8.1)
|
|
26
43
|
rainbow (3.1.1)
|
|
27
|
-
rake (13.
|
|
28
|
-
|
|
44
|
+
rake (13.3.1)
|
|
45
|
+
rdoc (7.2.0)
|
|
46
|
+
erb
|
|
47
|
+
psych (>= 4.0.0)
|
|
48
|
+
tsort
|
|
49
|
+
regexp_parser (2.12.0)
|
|
29
50
|
relaxed-rubocop (2.5)
|
|
30
|
-
reline (0.3
|
|
51
|
+
reline (0.6.3)
|
|
31
52
|
io-console (~> 0.5)
|
|
32
|
-
rexml (3.
|
|
33
|
-
rspec (3.
|
|
34
|
-
rspec-core (~> 3.
|
|
35
|
-
rspec-expectations (~> 3.
|
|
36
|
-
rspec-mocks (~> 3.
|
|
37
|
-
rspec-core (3.
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-expectations (3.
|
|
53
|
+
rexml (3.4.4)
|
|
54
|
+
rspec (3.13.2)
|
|
55
|
+
rspec-core (~> 3.13.0)
|
|
56
|
+
rspec-expectations (~> 3.13.0)
|
|
57
|
+
rspec-mocks (~> 3.13.0)
|
|
58
|
+
rspec-core (3.13.6)
|
|
59
|
+
rspec-support (~> 3.13.0)
|
|
60
|
+
rspec-expectations (3.13.5)
|
|
40
61
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
41
|
-
rspec-support (~> 3.
|
|
42
|
-
rspec-mocks (3.
|
|
62
|
+
rspec-support (~> 3.13.0)
|
|
63
|
+
rspec-mocks (3.13.8)
|
|
43
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
44
|
-
rspec-support (~> 3.
|
|
45
|
-
rspec-support (3.
|
|
46
|
-
rubocop (1.
|
|
65
|
+
rspec-support (~> 3.13.0)
|
|
66
|
+
rspec-support (3.13.7)
|
|
67
|
+
rubocop (1.86.0)
|
|
47
68
|
json (~> 2.3)
|
|
69
|
+
language_server-protocol (~> 3.17.0.2)
|
|
70
|
+
lint_roller (~> 1.1.0)
|
|
48
71
|
parallel (~> 1.10)
|
|
49
|
-
parser (>= 3.
|
|
72
|
+
parser (>= 3.3.0.2)
|
|
50
73
|
rainbow (>= 2.2.2, < 4.0)
|
|
51
|
-
regexp_parser (>=
|
|
52
|
-
|
|
53
|
-
rubocop-ast (>= 1.24.1, < 2.0)
|
|
74
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
75
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
54
76
|
ruby-progressbar (~> 1.7)
|
|
55
|
-
unicode-display_width (>= 2.4.0, <
|
|
56
|
-
rubocop-ast (1.
|
|
57
|
-
parser (>= 3.
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
78
|
+
rubocop-ast (1.49.1)
|
|
79
|
+
parser (>= 3.3.7.2)
|
|
80
|
+
prism (~> 1.7)
|
|
81
|
+
ruby-progressbar (1.13.0)
|
|
82
|
+
simplecov (0.22.0)
|
|
83
|
+
docile (~> 1.1)
|
|
84
|
+
simplecov-html (~> 0.11)
|
|
85
|
+
simplecov_json_formatter (~> 0.1)
|
|
86
|
+
simplecov-cobertura (3.1.0)
|
|
87
|
+
rexml
|
|
88
|
+
simplecov (~> 0.19)
|
|
89
|
+
simplecov-html (0.13.2)
|
|
90
|
+
simplecov_json_formatter (0.1.4)
|
|
91
|
+
stringio (3.2.0)
|
|
92
|
+
tsort (0.2.0)
|
|
93
|
+
unicode-display_width (3.2.0)
|
|
94
|
+
unicode-emoji (~> 4.1)
|
|
95
|
+
unicode-emoji (4.2.0)
|
|
60
96
|
|
|
61
97
|
PLATFORMS
|
|
62
98
|
ruby
|
|
@@ -69,6 +105,7 @@ DEPENDENCIES
|
|
|
69
105
|
relaxed-rubocop
|
|
70
106
|
rspec (~> 3.0)
|
|
71
107
|
rubocop (~> 1.7)
|
|
108
|
+
simplecov-cobertura
|
|
72
109
|
|
|
73
110
|
BUNDLED WITH
|
|
74
|
-
|
|
111
|
+
4.0.9
|
data/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/gouteur)
|
|
4
4
|
[](https://github.com/jaynetics/gouteur/actions)
|
|
5
|
+
[](https://codecov.io/gh/jaynetics/gouteur)
|
|
5
6
|
|
|
6
7
|
Treat the people that use your gem like royalty! Send for a [gouteur](https://en.wikipedia.org/wiki/Food_taster) before serving them something new!
|
|
7
8
|
|
|
@@ -29,17 +30,12 @@ Add `gouteur` to the development dependencies of your gem.
|
|
|
29
30
|
|
|
30
31
|
### Recommended usage
|
|
31
32
|
|
|
32
|
-
Create a `.gouteur.yml` in the root of your project:
|
|
33
|
+
Create a `.gouteur.yml` in the root of your project and add the gems you want to test against:
|
|
33
34
|
|
|
34
35
|
```yml
|
|
35
36
|
repos:
|
|
36
37
|
- uri: https://github.com/someone/some_gem
|
|
37
|
-
|
|
38
|
-
before: setup_special_dependency # optional, bundle is always installed
|
|
39
|
-
tasks: ['rspec', 'rake foo'] # optional, default is `rake`
|
|
40
|
-
name: cool_gem # optional, defaults to repo name from uri, e.g. `some_gem`
|
|
41
|
-
locked: true # optional, prevents setting an incompatible VERSION
|
|
42
|
-
force: true # optional, forces test even if VERSION is incompatible
|
|
38
|
+
- uri: https://github.com/someone/another_gem
|
|
43
39
|
```
|
|
44
40
|
|
|
45
41
|
Then simply `bundle exec gouteur` or add the rake task to your Rakefile:
|
|
@@ -52,13 +48,30 @@ Gouteur::RakeTask.new
|
|
|
52
48
|
task default: %i[rspec gouteur]
|
|
53
49
|
```
|
|
54
50
|
|
|
55
|
-
Pro tip: for large repos, running only relevant specs can speed up things a lot, e.g.:
|
|
51
|
+
Pro tip: gouteur executes the default rake task of each gem by default, but for large repos, running only relevant specs can speed up things a lot, e.g.:
|
|
56
52
|
|
|
57
53
|
```yml
|
|
58
|
-
|
|
54
|
+
repos:
|
|
55
|
+
- uri: some_gem_uri
|
|
56
|
+
tasks: 'rspec spec/known_relevant_spec.rb'
|
|
57
|
+
- uri: some_other_uri
|
|
58
|
+
tasks: 'rspec --pattern "**/{,*}{keyword1,keyword2}{,*,*/**/*}_spec.rb"'`
|
|
59
59
|
```
|
|
60
|
+
|
|
61
|
+
### Other configuration options
|
|
62
|
+
|
|
63
|
+
There are many other configuration options. All except the `uri` are optional.
|
|
64
|
+
|
|
60
65
|
```yml
|
|
61
|
-
|
|
66
|
+
repos:
|
|
67
|
+
- uri: https://github.com/someone/some_gem
|
|
68
|
+
ref: some_specific_branch # default is the default branch
|
|
69
|
+
subdir: the_actual_gem # if gem is in a subdir of the repo
|
|
70
|
+
before: setup_special_dependency # bundle is always installed
|
|
71
|
+
tasks: ['rspec', 'rake foo'] # default is `rake`
|
|
72
|
+
name: cool_gem # defaults to repo name from uri, e.g. `some_gem`
|
|
73
|
+
locked: true # prevents setting an incompatible VERSION
|
|
74
|
+
force: true # forces test even if VERSION is incompatible
|
|
62
75
|
```
|
|
63
76
|
|
|
64
77
|
### Manual usage
|
|
@@ -88,6 +101,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/jaynet
|
|
|
88
101
|
|
|
89
102
|
Possible future improvements:
|
|
90
103
|
|
|
104
|
+
- verbose mode
|
|
91
105
|
- consider caching of dependent repositories in CI, e.g. in GitHub workflows
|
|
92
106
|
- support more sources of code, e.g. latest release, private GitHub repositories
|
|
93
107
|
- improve performance by tracing & rerunning only specs/tests that use the gem
|
data/Rakefile
CHANGED
data/lib/gouteur/bundle.rb
CHANGED
data/lib/gouteur/message.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Gouteur
|
|
|
14
14
|
|
|
15
15
|
def success(repo:)
|
|
16
16
|
<<~MSG
|
|
17
|
-
|
|
17
|
+
π¨βπ³π #{random_word_for_tasty.capitalize}!
|
|
18
18
|
|
|
19
19
|
Your changes to `#{Host.name}` are fine for `#{repo}`. All tasks succeeded.
|
|
20
20
|
MSG
|
|
@@ -58,7 +58,7 @@ module Gouteur
|
|
|
58
58
|
|
|
59
59
|
def broken_after_update(repo:, task:, output:, error:)
|
|
60
60
|
<<~MSG
|
|
61
|
-
|
|
61
|
+
π¨βπ³π #{random_word_for_disgusting.capitalize}!
|
|
62
62
|
|
|
63
63
|
Task `#{task}` failed for `#{repo}` after inserting the new code of `#{Host.name}`.
|
|
64
64
|
|
data/lib/gouteur/repo.rb
CHANGED
|
@@ -3,7 +3,7 @@ require 'uri'
|
|
|
3
3
|
module Gouteur
|
|
4
4
|
# a repository of code that depends on the library under test
|
|
5
5
|
class Repo
|
|
6
|
-
attr_reader :uri, :name, :ref, :tasks
|
|
6
|
+
attr_reader :uri, :name, :ref, :tasks, :subdir
|
|
7
7
|
alias to_s name
|
|
8
8
|
|
|
9
9
|
def initialize(
|
|
@@ -13,7 +13,8 @@ module Gouteur
|
|
|
13
13
|
before: [],
|
|
14
14
|
tasks: 'rake',
|
|
15
15
|
locked: false,
|
|
16
|
-
force: false
|
|
16
|
+
force: false,
|
|
17
|
+
subdir: nil
|
|
17
18
|
)
|
|
18
19
|
@uri = uri
|
|
19
20
|
@name = name || extract_name_from_uri(uri)
|
|
@@ -22,10 +23,12 @@ module Gouteur
|
|
|
22
23
|
@tasks = Array(tasks)
|
|
23
24
|
@locked = !!locked
|
|
24
25
|
@force = !!force
|
|
26
|
+
@subdir = subdir
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
def fetch
|
|
28
30
|
cloned? ? pull : clone
|
|
31
|
+
validate_subdir if subdir
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
def prepare
|
|
@@ -40,8 +43,12 @@ module Gouteur
|
|
|
40
43
|
File.join(store_dir, name)
|
|
41
44
|
end
|
|
42
45
|
|
|
46
|
+
def bundle_path
|
|
47
|
+
subdir ? File.join(clone_path, subdir) : clone_path
|
|
48
|
+
end
|
|
49
|
+
|
|
43
50
|
def bundle
|
|
44
|
-
@bundle ||= Gouteur::Bundle.new(
|
|
51
|
+
@bundle ||= Gouteur::Bundle.new(bundle_path)
|
|
45
52
|
end
|
|
46
53
|
|
|
47
54
|
def gemfile
|
|
@@ -57,7 +64,7 @@ module Gouteur
|
|
|
57
64
|
end
|
|
58
65
|
|
|
59
66
|
def remove_host_from_gemspecs
|
|
60
|
-
Dir[File.join(
|
|
67
|
+
Dir[File.join(bundle_path, '*.gemspec')].each do |gemspec_path|
|
|
61
68
|
content = File.read(gemspec_path)
|
|
62
69
|
new_content = content.gsub(/^.+_dependency.+\b#{Host.name}\b.+$/, '')
|
|
63
70
|
File.write(gemspec_path, new_content)
|
|
@@ -66,6 +73,11 @@ module Gouteur
|
|
|
66
73
|
|
|
67
74
|
private
|
|
68
75
|
|
|
76
|
+
def validate_subdir
|
|
77
|
+
File.directory?(bundle_path) ||
|
|
78
|
+
raise(Error, "subdirectory `#{subdir}` not found in `#{name}`")
|
|
79
|
+
end
|
|
80
|
+
|
|
69
81
|
def extract_name_from_uri(uri)
|
|
70
82
|
uri[%r{git(?:hub|lab)\.com/[^/]+/([^/]+)}, 1] ||
|
|
71
83
|
uri.split('/').last.to_s[/[a-z0-9\-_]+/i] ||
|
data/lib/gouteur/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gouteur
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Janosch MuΜller
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Run tests of dependent gems against your changes.
|
|
14
13
|
email:
|
|
@@ -19,7 +18,6 @@ extensions: []
|
|
|
19
18
|
extra_rdoc_files: []
|
|
20
19
|
files:
|
|
21
20
|
- ".github/workflows/build.yml"
|
|
22
|
-
- ".github/workflows/lint.yml"
|
|
23
21
|
- ".gitignore"
|
|
24
22
|
- ".gouteur.yml"
|
|
25
23
|
- ".rspec"
|
|
@@ -53,7 +51,6 @@ metadata:
|
|
|
53
51
|
homepage_uri: https://github.com/jaynetics/gouteur
|
|
54
52
|
source_code_uri: https://github.com/jaynetics/gouteur
|
|
55
53
|
changelog_uri: https://github.com/jaynetics/gouteur/blob/master/CHANGELOG.md
|
|
56
|
-
post_install_message:
|
|
57
54
|
rdoc_options: []
|
|
58
55
|
require_paths:
|
|
59
56
|
- lib
|
|
@@ -68,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
65
|
- !ruby/object:Gem::Version
|
|
69
66
|
version: '0'
|
|
70
67
|
requirements: []
|
|
71
|
-
rubygems_version:
|
|
72
|
-
signing_key:
|
|
68
|
+
rubygems_version: 4.0.3
|
|
73
69
|
specification_version: 4
|
|
74
70
|
summary: See if your lib is still digestible.
|
|
75
71
|
test_files: []
|
data/.github/workflows/lint.yml
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# based on https://github.com/rails/rails/blob/4a78dcb/.github/workflows/rubocop.yml
|
|
2
|
-
|
|
3
|
-
name: rubocop linting
|
|
4
|
-
|
|
5
|
-
on: [push, pull_request]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v2
|
|
13
|
-
- name: Set up Ruby
|
|
14
|
-
uses: ruby/setup-ruby@v1
|
|
15
|
-
with:
|
|
16
|
-
ruby-version: 3.0
|
|
17
|
-
- name: Cache gems
|
|
18
|
-
uses: actions/cache@v1
|
|
19
|
-
with:
|
|
20
|
-
path: vendor/bundle
|
|
21
|
-
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
|
|
22
|
-
restore-keys: |
|
|
23
|
-
${{ runner.os }}-rubocop-
|
|
24
|
-
- name: Install gems
|
|
25
|
-
run: |
|
|
26
|
-
bundle config path vendor/bundle
|
|
27
|
-
bundle install --jobs 4 --retry 3
|
|
28
|
-
- name: Run rubocop
|
|
29
|
-
run: bundle exec rubocop
|