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

Add Ruby 3.3 to the CI test matrix #55

Merged
merged 2 commits into from
Jun 15, 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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ Metrics/MethodLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
RSpec/IndexedLet:
Enabled: false
Style/Documentation:
Enabled: false
55 changes: 29 additions & 26 deletions spec/shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ def wait_for(&block)
raise 'wait_for condition never realized'
end

def roundtrip_metric(metric)
message_id = next_message_id

client_with_transport << {
service: 'metric-test',
metric: metric,
message_id: message_id
}

e = wait_for_message_with_id(message_id)
expect(e.metric).to eq(metric)
end

RSpec.shared_examples 'a riemann client' do
it 'is not connected before sending' do
expect(client).not_to be_connected
Expand Down Expand Up @@ -113,18 +100,34 @@ def roundtrip_metric(metric)
end
end

it 'send longs' do
roundtrip_metric(0)
roundtrip_metric(-3)
roundtrip_metric(5)
roundtrip_metric(-(2**63))
roundtrip_metric(2**63 - 1)
end
context 'when sending metrics' do
[
0,
-3,
5,
-(2**63),
2**63 - 1,
0.0,
12.0,
1.2300000190734863
].each do |metric|
context "with metric=#{metric}" do
before do
client_with_transport << {
service: 'metric-test',
metric: metric,
message_id: message_id
}
end

it 'send doubles' do
roundtrip_metric 0.0
roundtrip_metric 12.0
roundtrip_metric 1.2300000190734863
let(:message_id) { next_message_id }

it 'return the exact value that was sent' do
e = wait_for_message_with_id(message_id)
expect(e.metric).to eq(metric)
end
end
end
end

context 'when sending custom attributes' do
Expand Down Expand Up @@ -485,7 +488,7 @@ def roundtrip_metric(metric)
sleep INACTIVITY_TIME

client_with_transport << message2
wait_for_message_with_id(message_id2)
expect { wait_for_message_with_id(message_id2) }.not_to raise_exception
end
end

Expand Down Expand Up @@ -517,7 +520,7 @@ def roundtrip_metric(metric)
client.close

client_with_transport << message2
wait_for_message_with_id(message_id2)
expect { wait_for_message_with_id(message_id2) }.not_to raise_exception
end
end

Expand Down