Skip to content

Commit 2df5f2d

Browse files
authored
Merge pull request #133 from FundingCircle/allow-running-the-build-manually
Allow running builds from contributors
2 parents 0a39c78 + 8b9c918 commit 2df5f2d

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ run-name: Build & Test - ${{ github.ref_name }}
33

44
on:
55
push:
6-
branches:
7-
- '**'
6+
branches: [ master ]
7+
pull_request:
88

99
jobs:
1010
version-check:

spec/integration/sinatra_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ class MySinatraApp < Sinatra::Base
122122
it 'logs the request with the exception' do
123123
get '/error', {}, 'HTTP_X_REQUEST_ID' => '700a6a01'
124124

125-
expect(last_log_entry).to start_with("E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method `name' for nil")
125+
exception_line =
126+
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.4.0dev')
127+
"E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method 'name' for nil"
128+
else
129+
"E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method `name' for nil"
130+
end
131+
132+
expect(last_log_entry).to start_with(exception_line)
126133
end
127134
end
128135
end

spec/support/request_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@
9797
{ username: 'yoshi' },
9898
'HTTP_USER_AGENT' => 'Chrome', 'HTTP_X_REQUEST_ID' => '471a34dc'
9999

100+
method_missing_exception =
101+
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.4.0dev')
102+
"undefined method 'name' for nil"
103+
else
104+
"undefined method `name' for nil"
105+
end
106+
100107
expect(last_log_entry).to include(
101108
'version' => '1.1',
102109
'host' => 'bird.example.com',
@@ -115,7 +122,7 @@
115122
'_request.request_id' => '471a34dc',
116123
'_request.duration' => 0,
117124
'_exception.klass' => 'NoMethodError',
118-
'_exception.message' => start_with("undefined method `name' for nil"),
125+
'_exception.message' => start_with(method_missing_exception),
119126
'_exception.backtrace' => be_a(String),
120127
'_tags' => '471a34dc TEST_TAG',
121128
)

0 commit comments

Comments
 (0)