Skip to content

Commit fbc31de

Browse files
committed
prepare for 4.0
- updates tests to work with Bundler.require - makes all pronto runner gems optionally required (preserves existing behavior) - adds one test to run pronto with all available runners - adds changelog info about breaking changes and upgrades - updates test.git to have an erb-lint.yml since erb-lint has some issues using String#yellow without bundling a dep that includes that
1 parent 9d5a3fd commit fbc31de

10 files changed

+49
-36
lines changed

.rspec

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
--color
2+
--format documentation
23
--require spec_helper

CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
4.0 | 2022-03-17
2+
---
3+
4+
**BREAKING CHANGES:**
5+
6+
* Pronto is upgraded to 0.11, the following runners are not yet compatible:
7+
- pronto-poper
8+
- pronto-rails_data_schema
9+
10+
Changes:
11+
12+
* Upgrades node.js to 14.x
13+
* Upgrades eslint_npm to 7.32.0
14+
* Upgrades stylelint to 13.13.1
15+
* Upgrades Bundler to 2.3.8
16+
* Upgrades Rubocop to 1.26.0
17+
* Upgrades all runners and dependencies
18+
119
2.5 | 2020-03-24
220
---
321

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Finally, create a release through GitHub's UI with a version bump and include CH
2020

2121
# Tests
2222

23-
Using `bundler/setup` in the test environment clears the load path for ruby, which prevents us from requiring gems that are already installed like `pronto` and the runners. For this reason, it is important not to use `Bundler.require` or `bundler/setup` in the test environment so that we can require gems from both the Gemfile _and_ those installed in the _base image_.
23+
Unzip the test git archive: `make spec/fixtures/test.git`
2424

2525
The test suite uses RSpec and WebMock.
2626

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ gem 'pronto-reek', require: false
1616
gem 'pronto-flay', require: false
1717
gem 'pronto-fasterer', require: false
1818
gem 'pronto-scss', require: false
19-
gem 'pronto-erb_lint', '~>0.1', require: false
19+
gem 'pronto-erb_lint', require: false
2020
gem 'pronto-stylelint', require: false
2121

2222
gem 'rubocop-performance', require: false

Gemfile.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ GEM
2525
smart_properties
2626
brakeman (5.2.1)
2727
builder (3.2.4)
28-
bundler-audit (0.7.0.1)
28+
bundler-audit (0.9.0.1)
2929
bundler (>= 1.2.0, < 3)
30-
thor (>= 0.18, < 2)
30+
thor (~> 1.0)
3131
climate_control (1.0.1)
3232
code_analyzer (0.5.5)
3333
sexp_processor
@@ -124,9 +124,9 @@ GEM
124124
pronto-brakeman (0.11.1)
125125
brakeman (>= 3.2.0)
126126
pronto (~> 0.11.0)
127-
pronto-bundler_audit (0.6.0)
128-
bundler-audit (~> 0)
129-
pronto (~> 0)
127+
pronto-bundler_audit (0.7.0)
128+
bundler-audit (~> 0.8)
129+
pronto (~> 0.11)
130130
pronto-erb_lint (0.1.5)
131131
erb_lint (~> 0.0.24)
132132
pronto (> 0.9.0)
@@ -233,7 +233,7 @@ GEM
233233
ruby2_keywords (0.0.5)
234234
ruby_parser (3.18.1)
235235
sexp_processor (~> 4.16)
236-
rugged (0.99.0)
236+
rugged (1.0.1)
237237
sass (3.7.4)
238238
sass-listen (~> 4.0.0)
239239
sass-listen (4.0.0)
@@ -248,7 +248,7 @@ GEM
248248
smart_properties (1.17.0)
249249
terminal-table (3.0.2)
250250
unicode-display_width (>= 1.1.1, < 3)
251-
thor (0.20.3)
251+
thor (1.2.1)
252252
tzinfo (2.0.4)
253253
concurrent-ruby (~> 1.0)
254254
unicode-display_width (2.1.0)
@@ -265,7 +265,7 @@ DEPENDENCIES
265265
pronto
266266
pronto-brakeman
267267
pronto-bundler_audit
268-
pronto-erb_lint (~> 0.1)
268+
pronto-erb_lint
269269
pronto-eslint_npm
270270
pronto-fasterer
271271
pronto-flay

pronto

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
require 'rubygems'
44
require 'bundler/setup'
5-
require 'pronto'
6-
require 'pronto/cli'
5+
Bundler.require(:default)
76
require_relative './src/github_action_check_run_formatter'
7+
require 'pronto/cli'
88

99
# github action inputs can only be strings, so when we passes the runners
1010
# list to this container, github passes container command args quoted like this:

spec/all_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
RSpec.describe 'all pronto runners' do
2+
it 'run without error' do
3+
Dir.chdir('spec/fixtures/test.git') do
4+
Pronto::CLI.start(%w(run))
5+
end
6+
end
7+
end

spec/fixtures/test.git.tar.gz

42 Bytes
Binary file not shown.

spec/github_action_check_run_formatter_spec.rb

+6-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
require 'pronto/cli'
2-
require 'src/github_action_check_run_formatter'
3-
41
RSpec.describe Pronto::Formatter::GithubActionCheckRunFormatter do
52

63
STUBBED_ENV = {
@@ -14,24 +11,17 @@
1411
end
1512
end
1613

17-
after do
18-
Pronto::Runner.repository.clear
19-
end
20-
2114
context 'when the runner is rubocop' do
2215
it 'posts a check run with annotations' do
2316
check_runs_url = "https://api.github.com/repos/Codertocat/Hello-World/check-runs"
2417
post_stub = stub_request(:post, check_runs_url).to_return(
2518
{status: 201, body: '{"id": 1}'},
2619
{status: 201, body: '{"id": 2}'},
2720
)
21+
allow(Pronto::Runner).to receive(:repository).and_return([Pronto::Rubocop])
2822

2923
Dir.chdir('spec/fixtures/test.git') do
30-
Pronto::CLI.start(%w(
31-
run
32-
-r rubocop
33-
-f github_action_check_run
34-
))
24+
Pronto::CLI.start(%w(run -f github_action_check_run))
3525
end
3626

3727
expect(
@@ -115,13 +105,10 @@
115105
{status: 201, body: '{"id": 1}'},
116106
{status: 201, body: '{"id": 2}'},
117107
)
108+
allow(Pronto::Runner).to receive(:repository).and_return([Pronto::YAMLLint])
118109

119110
Dir.chdir('spec/fixtures/test.git') do
120-
Pronto::CLI.start(%w(
121-
run
122-
-r yamllint
123-
-f github_action_check_run
124-
))
111+
Pronto::CLI.start(%w(run -f github_action_check_run))
125112
end
126113

127114
expect(
@@ -170,13 +157,10 @@
170157
{status: 201, body: '{"id": 1}'},
171158
{status: 201, body: '{"id": 2}'},
172159
)
160+
allow(Pronto::Runner).to receive(:repository).and_return([Pronto::Poper])
173161

174162
Dir.chdir('spec/fixtures/test.git') do
175-
Pronto::CLI.start(%w(
176-
run
177-
-r poper
178-
-f github_action_check_run
179-
))
163+
Pronto::CLI.start(%w(run -f github_action_check_run))
180164
end
181165

182166
expect(

spec/spec_helper.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
require 'climate_control'
2-
require 'pry'
31
require 'webmock/rspec'
2+
require 'rubygems'
3+
require 'bundler/setup'
4+
Bundler.require(:default, :test)
5+
require 'pronto/cli'
46
$LOAD_PATH.push(File.dirname(__dir__))
7+
require 'src/github_action_check_run_formatter'

0 commit comments

Comments
 (0)