Skip to content

Commit

Permalink
Merge branch 'master' into ivoanjo/fix-flaky-profiler-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoanjo authored Nov 6, 2024
2 parents a3c8db5 + 3e73b3b commit 5d0390d
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 306 deletions.
374 changes: 79 additions & 295 deletions .circleci/config.yml

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: Check
on:
push:
branches: [ '**' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ '**' ]

jobs:
lint:
runs-on: ubuntu-latest
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bundle install
- run: bundle exec rake rubocop standard

check:
name: Check types
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install dependencies
run: bundle install
- name: Check for stale signature files
run: bundle exec rake rbs:stale
- name: Check for missing signature files
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ namespace :test do
command = if appraisal_group.empty?
"bundle exec rake #{spec_task}"
else
"bundle exec appraisal #{ruby_runtime}-#{appraisal_group} rake #{spec_task}"
gemfile = File.join(File.dirname(__FILE__), 'gemfiles', "#{ruby_runtime}-#{appraisal_group}.gemfile".tr('-', '_'))
"env BUNDLE_GEMFILE=#{gemfile} bundle exec rake #{spec_task}"
end

command += "'[#{spec_arguments}]'" if spec_arguments
Expand Down
3 changes: 3 additions & 0 deletions appraisal/ruby-3.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
gem 'sneakers', '>= 2.12.0'
gem 'sucker_punch'
gem 'que', '>= 1.0.0'

# When Rack 3+ is used, we need rackup.
gem 'rackup'
end

[
Expand Down
18 changes: 18 additions & 0 deletions docs/DevelopmentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ TEST_METADATA = {
}
```

**Using appraisal**

`appraisal` command should only be used to update gemfiles in `gemfiles/`
and install dependencies. It should not be used to run tests, since it does not
work in all configurations. To run the tests, use:

```sh
env BUNDLE_GEMFILE=gemfiles/#{ruby_runtime}_#{appraisal_group}.gemfile rake #{spec_task}
```

Note that the file names use underscores while appraisal group and
configuration definitions use dashes. The conversion could be performed as
follows:

```sh
env BUNDLE_GEMFILE=gemfiles/#{ruby_runtime.tr('-', '_')}_#{appraisal_group.tr('-', '_')}.gemfile rake #{spec_task}
```

**Working with appraisal groups**

Checkout [Apppraisal](https://github.com/thoughtbot/appraisal) to learn the basics.
Expand Down
1 change: 1 addition & 0 deletions gemfiles/ruby_3.4_contrib.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions gemfiles/ruby_3.4_contrib.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/datadog/tracing/contrib/suite/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

require 'rack'
# `Rack::Handler::WEBrick` was extracted to the `rackup` gem in Rack 3.0
require 'rackup' if Rack::VERSION[0] >= 3
require 'rackup' if Gem::Version.new(Rack::RELEASE) >= Gem::Version.new('3')
require 'webrick'

RSpec.describe 'contrib integration testing', :integration do
Expand Down

0 comments on commit 5d0390d

Please sign in to comment.