Skip to content

Commit

Permalink
Add missing GraphQL and Hanami tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Sep 20, 2024
1 parent 6b99807 commit 3644858
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
19 changes: 12 additions & 7 deletions Matrixfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env ruby
# coding: UTF-8 # rubocop:disable Style/Encoding
# frozen_string_literal: true

Expand Down Expand Up @@ -79,11 +80,11 @@
'grape' => {
'activesupport' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
},
'graphql' => {
'graphql-2.3' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.2' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.1' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.0' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
['graphql', 'graphql_unified_trace_patcher', 'graphql_trace_patcher', 'graphql_tracing_patcher'] => {
'graphql-2.3' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.2' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.1' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-2.0' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
# Although GraphQL 1.13.x depends on Ruby >= 2.4, but it does not work with Ruby 2.5
#
# require 'graphql'
Expand Down Expand Up @@ -243,7 +244,7 @@
'rails6-postgres-redis' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ❌ 3.3 / ❌ 3.4 / ✅ jruby',
'rails61-postgres-redis' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
},
'hanami' => {
['hanami', 'hanami_autoinstrument'] => {
'hanami-1' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ❌ 3.3 / ❌ 3.4 / ❌ jruby'
},
'sinatra' => {
Expand Down Expand Up @@ -283,7 +284,11 @@
'graphql-2.0' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'graphql-1.13' => '❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
}
}.freeze
}.flat_map do |tasks, spec_metadata|
# Explode arrays of task names into individual tasks
# e.g. ['rails', 'railsdisableenv'] => {'...'} becomes [['rails7', '...'], ['railsdisableenv7', '...']]
Array(tasks).map { |task| [task, spec_metadata] }
end.freeze
# rubocop:enable Layout/HashAlignment

# vim: ft=ruby
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ end
desc 'Run RSpec'
# rubocop:disable Metrics/BlockLength
namespace :spec do
# REMINDER: If adding a new task here, make sure also add it to the `Matrixfile`
task all: [:main, :benchmark,
:graphql, :graphql_unified_trace_patcher, :graphql_trace_patcher, :graphql_tracing_patcher,
:rails, :railsredis, :railsredis_activesupport, :railsactivejob,
Expand Down Expand Up @@ -227,6 +228,7 @@ namespace :spec do
end

# Datadog Tracing integrations
# REMINDER: If adding a new task here, make sure also add it to the `Matrixfile`
[
:action_cable,
:action_mailer,
Expand Down
10 changes: 5 additions & 5 deletions docs/DevelopmentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ All tests should run in CI. When adding new `_spec.rb` files, you may need to ad
```ruby
namespace :spec do
RSpec::Core::RakeTask.new(:foo) do |t, args|
t.pattern = "spec/datadog/tracing/contrib/bar/**/*_spec.rb"
t.pattern = "spec/datadog/tracing/contrib/foo/**/*_spec.rb"
t.rspec_opts = args.to_a.join(' ')
end
end
```

- Ensure the Rake task is configured to run for the appropriate Ruby runtimes, by introducing it to our test matrix. You should find the task with `bundle exec rake -T test:<foo>`.
- Ensure the Rake task is configured to run for the appropriate Ruby runtimes, by adding it to our `Matrixfile`. You should find the task with `bundle exec rake -T test:foo` after adding it.

```ruby
TEST_METADATA = {
{
'foo' => {
# Without any appraisal group dependencies
'' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby',
# or with appraisal group definition `bar`
'bar' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
# or with appraisal group definition `foo-on-rails`, that includes additional gems
'foo-on-rails' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
}
```
Expand Down

0 comments on commit 3644858

Please sign in to comment.