Skip to content

Commit

Permalink
Merge pull request #161 from DataDog/1.0
Browse files Browse the repository at this point in the history
Merge 1.0 branch into main
  • Loading branch information
anmarchenko authored Apr 22, 2024
2 parents c23eabe + 314ab7e commit abea9c1
Show file tree
Hide file tree
Showing 383 changed files with 7,595 additions and 2,037 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ Gemfile-*.lock
.ruby-version
.DS_Store
/test.rb

# Native extension binaries
lib/**/*.bundle
lib/**/*.so
lib/**/*.o
lib/**/*.dylib
lib/**/*.dll

4 changes: 2 additions & 2 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ruby_version: 2.1
ruby_version: 2.7
format: progress

ignore:
- 'gemfiles/**/*'
- 'tasks/**/*'
- 'yard/**/*'
- 'yard/**/*'
8 changes: 0 additions & 8 deletions .standard_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
ignore:
- lib/datadog/ci/test_visibility/serializers/base.rb:
- Style/HashExcept
- lib/datadog/ci/contrib/minitest/integration.rb:
- Style/SafeNavigation
- lib/datadog/ci/contrib/cucumber/integration.rb:
- Style/SafeNavigation
- lib/datadog/ci/contrib/rspec/integration.rb:
- Style/SafeNavigation
- lib/datadog/ci/ext/environment.rb:
- Style/SafeNavigation
- spec/support/log_helpers.rb:
- Performance/UnfreezeString
- Appraisals:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## [Unreleased]

## [1.0.0.beta1] - 2024-03-25

### Added

* datadog-cov native extension for per test code coverage ([#137])
* citestcov transport to serialize and send code coverage events ([#148])

### Removed

* Ruby 2.1-2.6 support is dropped

## [0.8.3] - 2024-03-20

### Fixed
Expand Down Expand Up @@ -188,6 +199,7 @@ Currently test suite level visibility is not used by our instrumentation: it wil
* Ruby versions < 2.7 no longer supported ([#8][])

[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v0.8.3...main
[1.0.0.beta1]: https://github.com/DataDog/datadog-ci-rb/compare/v0.8.3...v1.0.0.beta1
[0.8.3]: https://github.com/DataDog/datadog-ci-rb/compare/v0.8.2...v0.8.3
[0.8.2]: https://github.com/DataDog/datadog-ci-rb/compare/v0.8.1...v0.8.2
[0.8.1]: https://github.com/DataDog/datadog-ci-rb/compare/v0.8.0...v0.8.1
Expand Down Expand Up @@ -258,7 +270,9 @@ Currently test suite level visibility is not used by our instrumentation: it wil
[#123]: https://github.com/DataDog/datadog-ci-rb/issues/123
[#131]: https://github.com/DataDog/datadog-ci-rb/issues/131
[#134]: https://github.com/DataDog/datadog-ci-rb/issues/134
[#137]: https://github.com/DataDog/datadog-ci-rb/issues/137
[#139]: https://github.com/DataDog/datadog-ci-rb/issues/139
[#141]: https://github.com/DataDog/datadog-ci-rb/issues/141
[#142]: https://github.com/DataDog/datadog-ci-rb/issues/142
[#145]: https://github.com/DataDog/datadog-ci-rb/issues/145
[#148]: https://github.com/DataDog/datadog-ci-rb/issues/148
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ source "https://rubygems.org"
# Specify your gem's dependencies in datadog-ci.gemspec
gemspec

# needed to run tests, always present at runtime
gem "ddtrace"

gem "pry"
gem "rake"
gem "os"

# To compile native extensions
gem "rake-compiler"

gem "climate_control"

gem "rspec"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Component,Origin,License,Copyright
dd-trace-rb,https://github.com/DataDog/dd-trace-rb,Apache 2.0,"Copyright 2016-Present Datadog, Inc."
datadog,https://github.com/DataDog/dd-trace-rb,Apache 2.0,"Copyright 2016-Present Datadog, Inc."
msgpack,https://rubygems.org/gems/msgpack,Apache-2.0,"Copyright (c) 2008-2015 Sadayuki Furuhashi"
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
Datadog's Ruby Library for instrumenting your test and continuous integration pipeline.
Learn more on our [official website](https://docs.datadoghq.com/tests/) and check out our [documentation for this library](https://docs.datadoghq.com/tests/setup/ruby/?tab=cloudciprovideragentless).

> [!IMPORTANT]
> The `datadog-ci` gem is currently a component of [`ddtrace`](https://github.com/datadog/dd-trace-rb) and should not be used without it.
>
> We expect this to change in the future.
## Installation

Add to your Gemfile.

```ruby
gem "ddtrace"
group :test do
gem "datadog-ci"
end
```

## Usage
Expand Down Expand Up @@ -52,7 +49,6 @@ end
| --- | ----------- | ------- |
| `enabled` | Defines whether RSpec tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
| `service_name` | Service name used for `rspec` instrumentation. | `'rspec'` |
| `operation_name` | *DEPRECATED, to be removed in 1.0* Operation name used for `rspec` instrumentation (has no effect in agentless mode or when using newer agent versions). | `'rspec.example'` |

### Minitest

Expand Down Expand Up @@ -104,7 +100,6 @@ end
| --- | ----------- | ------- |
| `enabled` | Defines whether Minitest tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
| `service_name` | Service name used for `minitest` instrumentation. | `'minitest'` |
| `operation_name` | *DEPRECATED, to be removed in 1.0* Operation name used for `minitest` instrumentation (has no effect in agentless mode or when using newer agent versions). | `'minitest.test'` |

### Cucumber

Expand Down Expand Up @@ -135,7 +130,6 @@ end
| --- | ----------- | ------- |
| `enabled` | Defines whether Cucumber tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
| `service_name` | Service name used for `cucumber` instrumentation. | `'cucumber'` |
| `operation_name` | *DEPRECATED, to be removed in 1.0* Operation name used for `cucumber` instrumentation (has no effect in agentless mode or when using newer agent versions). | `'cucumber.test'` |

## Agentless mode

Expand Down
24 changes: 22 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require_relative "lib/datadog/ci/version"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "yard"
require "rake/extensiontask"

RSpec::Core::RakeTask.new(:spec)

Expand Down Expand Up @@ -107,8 +108,12 @@ end
namespace :spec do
desc "" # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:main) do |t, args|
t.pattern = "spec/**/*_spec.rb"
t.exclude_pattern = "spec/**/{contrib}/**/*_spec.rb,"
t.pattern = if RUBY_ENGINE == "jruby"
"spec/datadog/**/*_spec.rb"
else
"spec/datadog/**/*_spec.rb,spec/ddcov/**/*_spec.rb"
end
t.exclude_pattern = "spec/datadog/**/{contrib}/**/*_spec.rb,"
t.rspec_opts = args.to_a.join(" ")
end

Expand All @@ -132,3 +137,18 @@ end

desc "CI task; it runs all tests for current version of Ruby"
task ci: "test:all"

# native extensions
Rake::ExtensionTask.new("datadog_cov.#{RUBY_VERSION}_#{RUBY_PLATFORM}") do |ext|
ext.ext_dir = "ext/datadog_cov"
end

task :compile_ext do
if RUBY_ENGINE == "ruby"
Rake::Task[:clean].invoke
Rake::Task[:compile].invoke
end
end

# run compile before any tests are run
Rake::Task["test:all"].prerequisite_tasks.each { |t| t.enhance([:compile_ext]) }
4 changes: 4 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ target :lib do
library "minitest"
library "net-http"
library "zlib"
library "securerandom"
library "tmpdir"
library "fileutils"
library "socket"

repo_path "vendor/rbs"
library "ddtrace"
Expand Down
5 changes: 5 additions & 0 deletions datadog-ci.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ Gem::Specification.new do |spec|
LICENSE*
NOTICE
README.md
ext/**/*
lib/**/*
]].select { |fn| File.file?(fn) } # We don't want directories, only files
.reject { |fn| fn.end_with?(".so", ".bundle") } # Exclude local native binary artifacts

spec.require_paths = ["lib"]

spec.add_dependency "datadog", "~> 2.0.0.beta2"
spec.add_dependency "msgpack"

spec.extensions = ["ext/datadog_cov/extconf.rb"]
end
Loading

0 comments on commit abea9c1

Please sign in to comment.