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 cucumber 8.0.0 support #7

Merged
merged 1 commit into from
Aug 18, 2023
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
42 changes: 5 additions & 37 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
# require 'ddtrace/version'

module DisableBundleCheck
def check_command
Expand Down Expand Up @@ -46,27 +45,6 @@ def appraise(group, &block)
end
end

# def self.with_cucumber_gem(version)
# appraise "cucumber#{version}" do
# gem "cucumber", "~>#{version}"
# # Locks the profiler's protobuf dependency to avoid conflict with cucumber.
# # Without this, we can get this error:
# # > TypeError:
# # > superclass mismatch for class FileDescriptorSet
# # This happens because cucumber has its own Protobuf gem (`protobuf-cucumber`)
# # that conflicts with `google-protobuf`: the load slightly different version of the same classes.
# # Locking them together ensures they don't have conflicting class declaration.
# # This only affects: 4.0.0 >= cucumber > 7.0.0.
# #
# # DEV: Ideally, the profiler would not be loaded when running cucumber tests as it is unrelated.
# if Gem::Version.new(version) >= Gem::Version.new("4.0.0") &&
# Gem::Version.new(version) < Gem::Version.new("7.0.0")
# gem "google-protobuf", "3.10.1" if RUBY_PLATFORM != "java"
# gem "protobuf-cucumber", "3.10.8"
# end
# end
# end

def self.with_rspec_gem(versions: 3)
Array(versions).each do |v|
appraise "rspec-#{v}" do
Expand All @@ -91,16 +69,6 @@ def self.with_minitest_gem(versions: 5)
end
end

# WIP: Support cucumber 8

# | Cucumber | Ruby required |
# |----------|---------------|
# | 3.x | 2.2+ |
# | 4.x | 2.3+ |
# | 5.x | 2.5+ |
# | 6.x | 2.5+ |
# | 7.x | 2.5+ |
# | 8.x | 2.6+ |
if ruby_version?("2.1")
with_rspec_gem
elsif ruby_version?("2.2")
Expand All @@ -117,23 +85,23 @@ elsif ruby_version?("2.5")
with_cucumber_gem(versions: 3..7)
elsif ruby_version?("2.6")
with_rspec_gem
with_cucumber_gem(versions: 3..7)
with_cucumber_gem(versions: 3..8)
elsif ruby_version?("2.7")
with_minitest_gem
with_rspec_gem
with_cucumber_gem(versions: 3..7)
with_cucumber_gem(versions: 3..8)
elsif ruby_version?("3.0")
with_minitest_gem
with_rspec_gem
with_cucumber_gem(versions: 3..7)
with_cucumber_gem(versions: 3..8)
elsif ruby_version?("3.1")
with_minitest_gem
with_rspec_gem
with_cucumber_gem(versions: 3..7)
with_cucumber_gem(versions: 3..8)
elsif ruby_version?("3.2")
with_minitest_gem
with_rspec_gem
with_cucumber_gem(versions: 3..7)
with_cucumber_gem(versions: 3..8)
end

ruby_runtime = if defined?(RUBY_ENGINE_VERSION)
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Datadog::CI
# Datadog CI Visibility for Ruby

Datadog's Ruby Library for instrumenting your test and continuous integration pipeline. Checkout to learn more at our [official website](https://docs.datadoghq.com/continuous_integration/tests/ruby/?tab=azurepipelines).

## Installation

Add to your Gemfile.
```

```ruby
group :test do
gem "datadog-ci"
end
Expand Down Expand Up @@ -45,7 +46,6 @@ end
| `service_name` | Service name used for `rspec` instrumentation. | `'rspec'` |
| `operation_name` | Operation name used for `rspec` instrumentation. Useful if you want rename automatic trace metrics e.g. `trace.#{operation_name}.errors`. | `'rspec.example'` |


### Minitest

The Minitest integration will trace all executions of tests when using `minitest` test framework.
Expand Down Expand Up @@ -118,8 +118,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Datadog/datadog-ci. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Datadog/datadog-ci/blob/main/CODE_OF_CONDUCT.md).

Bug reports and pull requests are welcome on [GitHub](https://github.com/Datadog/datadog-ci). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Datadog/datadog-ci/blob/main/CODE_OF_CONDUCT.md).

## Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ task :ci do
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-5 rake spec:cucumber"
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-6 rake spec:cucumber"
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-7 rake spec:cucumber"
# declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-8 rake spec:cucumber"
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-8 rake spec:cucumber"

# Minitest
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal minitest-5 rake spec:minitest"
Expand Down
1 change: 0 additions & 1 deletion datadog-ci.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
spec.add_dependency "ddtrace", "~> 1"

# For more information and examples about making a new gem, check out our
Expand Down
22 changes: 22 additions & 0 deletions gemfiles/jruby_9.2.21.0_cucumber_8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "pry"
gem "rake"
gem "rspec"
gem "os"
gem "climate_control"
gem "rspec-collection_matchers"
gem "rspec_junit_formatter"
gem "appraisal"
gem "standard", "<= 1.24.3"
gem "yard"
gem "webrick"
gem "cucumber", "~> 8"

group :check do

end

gemspec path: "../"
22 changes: 22 additions & 0 deletions gemfiles/jruby_9.3.9.0_cucumber_8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "pry"
gem "rake"
gem "rspec"
gem "os"
gem "climate_control"
gem "rspec-collection_matchers"
gem "rspec_junit_formatter"
gem "appraisal"
gem "standard", "<= 1.24.3"
gem "yard"
gem "webrick"
gem "cucumber", "~> 8"

group :check do

end

gemspec path: "../"
140 changes: 140 additions & 0 deletions gemfiles/jruby_9.3.9.0_cucumber_8.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
PATH
remote: ..
specs:
datadog-ci (0.1.0)
ddtrace (~> 1)

GEM
remote: https://rubygems.org/
specs:
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
cucumber (8.0.0)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.0, >= 9.0.4)
cucumber-core (~> 11.0, >= 11.0.0)
cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-html-formatter (~> 19.1, >= 19.1.0)
cucumber-messages (~> 18.0, >= 18.0.0)
diff-lcs (~> 1.5, >= 1.5.0)
mime-types (~> 3.4, >= 3.4.1)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-ci-environment (9.2.0)
cucumber-core (11.0.0)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
cucumber-cucumber-expressions (15.2.0)
cucumber-gherkin (23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-html-formatter (19.2.0)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-messages (18.0.0)
cucumber-tag-expressions (4.1.0)
ddtrace (1.13.1)
debase-ruby_core_source (= 3.2.1)
libdatadog (~> 3.0.0.1.0)
libddwaf (~> 1.9.0.0.0)
msgpack
debase-ruby_core_source (3.2.1)
diff-lcs (1.5.0)
ffi (1.15.5-java)
json (2.6.3-java)
language_server-protocol (3.17.0.3)
libdatadog (3.0.0.1.0)
libddwaf (1.9.0.0.1-java)
ffi (~> 1.0)
method_source (1.0.0)
mime-types (3.5.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
msgpack (1.7.2-java)
multi_test (1.1.0)
os (1.1.4)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pry (0.14.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
racc (1.7.1-java)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.44.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.15.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
spoon (0.0.6)
ffi
standard (1.24.3)
language_server-protocol (~> 3.17.0.2)
rubocop (= 1.44.1)
rubocop-performance (= 1.15.2)
sys-uname (1.2.3)
ffi (~> 1.1)
thor (1.2.2)
unicode-display_width (2.4.2)
webrick (1.8.1)
yard (0.9.34)

PLATFORMS
universal-java-11

DEPENDENCIES
appraisal
climate_control
cucumber (~> 8)
datadog-ci!
os
pry
rake
rspec
rspec-collection_matchers
rspec_junit_formatter
standard (<= 1.24.3)
webrick
yard

BUNDLED WITH
2.3.26
22 changes: 22 additions & 0 deletions gemfiles/jruby_9.4.0.0_cucumber_8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "pry"
gem "rake"
gem "rspec"
gem "os"
gem "climate_control"
gem "rspec-collection_matchers"
gem "rspec_junit_formatter"
gem "appraisal"
gem "standard", "<= 1.24.3"
gem "yard"
gem "webrick"
gem "cucumber", "~> 8"

group :check do

end

gemspec path: "../"
Loading