-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45d5d79
commit 1169f66
Showing
4 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
module Datadog | ||
module CI | ||
module ITR | ||
# Intelligent test runner implementation | ||
# Integrates with backend to provide test impact analysis data and | ||
# skip tests that are not impacted by the changes | ||
class Runner | ||
def initialize( | ||
enabled: false | ||
) | ||
@enabled = enabled | ||
end | ||
|
||
def enabled? | ||
@enabled | ||
end | ||
|
||
def configure | ||
return unless enabled? | ||
|
||
Datadog.logger.debug("Sending ITR settings request...") | ||
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,15 @@ | ||
module Datadog | ||
module CI | ||
module ITR | ||
class Runner | ||
@enabled: bool | ||
|
||
def initialize: (?enabled: bool) -> void | ||
|
||
def enabled?: () -> bool | ||
|
||
def configure: () -> void | ||
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,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../../../../lib/datadog/ci/itr/runner" | ||
|
||
RSpec.describe Datadog::CI::ITR::Runner do | ||
let(:itr_enabled) { true } | ||
subject(:runner) { described_class.new(enabled: itr_enabled) } | ||
|
||
describe "#configure" do | ||
context "itr enabled" do | ||
before do | ||
expect(Datadog.logger).to receive(:debug).with("Sending ITR settings request...") | ||
end | ||
|
||
it { runner.configure } | ||
end | ||
|
||
context "itr disabled" do | ||
let(:itr_enabled) { false } | ||
|
||
before do | ||
expect(Datadog.logger).to_not receive(:debug).with("Sending ITR settings request...") | ||
end | ||
|
||
it { runner.configure } | ||
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