Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Oct 1, 2024
1 parent 98f03e5 commit 22d3cc4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/datadog/ci/test_optimisation/coverage/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@
end

context "when file paths are relative" do
let(:current_folder) { File.basename(Dir.pwd) }

before do
Datadog::CI::Git::LocalRepository.remove_instance_variable(:@prefix_to_root)

allow(Datadog::CI::Git::LocalRepository).to receive(:root).and_return(
Dir.pwd.gsub("/datadog-ci-rb", "")
Dir.pwd.gsub("/#{current_folder}", "")
)
end

Expand All @@ -131,8 +133,8 @@
"test_suite_id" => 2,
"span_id" => 1,
"files" => [
{"filename" => "datadog-ci-rb/project/file.rb"},
{"filename" => "datadog-ci-rb/project/file2.rb"}
{"filename" => "#{current_folder}/project/file.rb"},
{"filename" => "#{current_folder}/project/file2.rb"}
]
}
)
Expand Down

0 comments on commit 22d3cc4

Please sign in to comment.