Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running builds from contributors #133

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ run-name: Build & Test - ${{ github.ref_name }}

on:
push:
branches:
- '**'
branches: [ master ]
pull_request:

jobs:
version-check:
Expand Down
9 changes: 8 additions & 1 deletion spec/integration/sinatra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ class MySinatraApp < Sinatra::Base
it 'logs the request with the exception' do
get '/error', {}, 'HTTP_X_REQUEST_ID' => '700a6a01'

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")
exception_line =
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.4.0dev')
"E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method 'name' for nil"
else
"E, #{time_pid_tags} GET /error 500 in 0ms type=request #{data_as_text} exception=undefined method `name' for nil"
end

expect(last_log_entry).to start_with(exception_line)
end
end
end
Expand Down
9 changes: 8 additions & 1 deletion spec/support/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
{ username: 'yoshi' },
'HTTP_USER_AGENT' => 'Chrome', 'HTTP_X_REQUEST_ID' => '471a34dc'

method_missing_exception =
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.4.0dev')
"undefined method 'name' for nil"
else
"undefined method `name' for nil"
end

expect(last_log_entry).to include(
'version' => '1.1',
'host' => 'bird.example.com',
Expand All @@ -115,7 +122,7 @@
'_request.request_id' => '471a34dc',
'_request.duration' => 0,
'_exception.klass' => 'NoMethodError',
'_exception.message' => start_with("undefined method `name' for nil"),
'_exception.message' => start_with(method_missing_exception),
'_exception.backtrace' => be_a(String),
'_tags' => '471a34dc TEST_TAG',
)
Expand Down