From 22d3cc45e56dcb58015841a7aeaf26cd8684a74a Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 1 Oct 2024 14:28:19 +0200 Subject: [PATCH] fix failing tests --- spec/datadog/ci/test_optimisation/coverage/event_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/datadog/ci/test_optimisation/coverage/event_spec.rb b/spec/datadog/ci/test_optimisation/coverage/event_spec.rb index 238dd66b..cf54de43 100644 --- a/spec/datadog/ci/test_optimisation/coverage/event_spec.rb +++ b/spec/datadog/ci/test_optimisation/coverage/event_spec.rb @@ -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 @@ -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"} ] } )