-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from DataDog/anmarchenko/ci_queue_standalone_…
…integration [SDTEST-1129] extract ciqueue instrumentation
- Loading branch information
Showing
7 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../integration" | ||
require_relative "patcher" | ||
|
||
module Datadog | ||
module CI | ||
module Contrib | ||
module Ciqueue | ||
# ci-queue test runner instrumentation | ||
# https://github.com/Shopify/ci-queue | ||
class Integration < Contrib::Integration | ||
MINIMUM_VERSION = Gem::Version.new("0.9.0") | ||
|
||
def version | ||
Gem.loaded_specs["ci-queue"]&.version | ||
end | ||
|
||
def loaded? | ||
!defined?(::RSpec::Queue::Runner).nil? | ||
end | ||
|
||
def compatible? | ||
super && version >= MINIMUM_VERSION | ||
end | ||
|
||
def patcher | ||
Patcher | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../patcher" | ||
require_relative "../rspec/runner" | ||
|
||
module Datadog | ||
module CI | ||
module Contrib | ||
module Ciqueue | ||
# Patcher enables patching of 'rspec' module. | ||
module Patcher | ||
include Datadog::CI::Contrib::Patcher | ||
|
||
module_function | ||
|
||
def patch | ||
::RSpec::Queue::Runner.include(Contrib::RSpec::Runner) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Datadog | ||
module CI | ||
module Contrib | ||
module Ciqueue | ||
class Integration < Contrib::Integration | ||
MINIMUM_VERSION: untyped | ||
|
||
def version: () -> untyped | ||
|
||
def loaded?: () -> bool | ||
|
||
def compatible?: () -> bool | ||
|
||
def patcher: () -> singleton(Patcher) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Datadog | ||
module CI | ||
module Contrib | ||
module Ciqueue | ||
module Patcher | ||
include Datadog::CI::Contrib::Patcher | ||
|
||
def self?.patch: () -> void | ||
end | ||
end | ||
end | ||
end | ||
end |