Skip to content

Commit

Permalink
male threading_mode mandatory argument for DDCov
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jun 10, 2024
1 parent 1d6553f commit 4ab5804
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/datadog_cov/datadog_cov.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static VALUE dd_cov_initialize(int argc, VALUE *argv, VALUE self)

VALUE rb_threading_mode = rb_hash_lookup(opt, ID2SYM(rb_intern("threading_mode")));
int threading_mode;
if (!RTEST(rb_threading_mode) || rb_threading_mode == ID2SYM(rb_intern("multi")))
if (rb_threading_mode == ID2SYM(rb_intern("multi")))
{
threading_mode = MULTI_THREADED_COVERAGE_MODE;
}
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/itr/coverage/ddcov.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Datadog
class DDCov
type threading_mode = :multi | :single

def initialize: (root: String, ignored_path: String?, ?threading_mode: threading_mode?) -> void
def initialize: (root: String, ignored_path: String?, threading_mode: threading_mode) -> void

def start: () -> void

Expand Down
3 changes: 2 additions & 1 deletion spec/ddcov/ddcov_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def absolute_path(path)
end

let(:ignored_path) { nil }
subject { described_class.new(root: root, ignored_path: ignored_path) }
let(:threading_mode) { :multi }
subject { described_class.new(root: root, ignored_path: ignored_path, threading_mode: threading_mode) }

describe "code coverage collection" do
let!(:calculator) { Calculator.new }
Expand Down
2 changes: 1 addition & 1 deletion spec/ddcov/ddcov_with_symlinks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def absolute_path(path)
)
end

subject { described_class.new(root: root) }
subject { described_class.new(root: root, threading_mode: :multi) }

describe "code coverage collection" do
let!(:calculator) { Calculator.new }
Expand Down

0 comments on commit 4ab5804

Please sign in to comment.