From 5fdaa96bb81048af638a490d6b305cb3dbc9e6b8 Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Fri, 23 Jul 2021 09:17:24 -0500 Subject: [PATCH] fix: Add source tag to cobertura script --- script/coverage-json-to-cobertura | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/script/coverage-json-to-cobertura b/script/coverage-json-to-cobertura index 2315f920..ec0f9e7b 100755 --- a/script/coverage-json-to-cobertura +++ b/script/coverage-json-to-cobertura @@ -68,6 +68,14 @@ files = } end) +source = + if System.get_env("CI_BUILDS_DIR") do + "#{System.get_env("CI_BUILDS_DIR")}/#{System.get_env("PROJECT_FULL_PATH")}" + else + File.cwd! + end + + buffer = XmlBuilder.document([ XmlBuilder.doctype( @@ -80,6 +88,17 @@ buffer = "line-rate" => ratio, }, [ + { + :sources, + %{}, + [ + { + :source, + %{}, + source + } + ] + }, { :packages, %{},