cobertura-merge icon indicating copy to clipboard operation
cobertura-merge copied to clipboard

Can we have file pattern support in addition/instead of multiple file inputs

Open dpurohit18 opened this issue 4 years ago • 3 comments

In enterprise projects where the coverage results' files are huge and dynamic in nature, can we pass on a 'FILE_PATTERN' instead of supplying individual inputs?

dpurohit18 avatar Nov 26 '20 15:11 dpurohit18

Hello, are there any updates? seems like usefull feature? or maybe anyone could recommend alternative solutions?

ivan-shaban-godel avatar Dec 11 '23 09:12 ivan-shaban-godel

A workaround:

npx cobertura-merge -p -o output.xml $(ls coverage/**/cobertura-coverage.xml | awk -v ORS=" " -v OFS="" '{ print "package", NR, "=", $0 }')

gofabian avatar Mar 27 '24 13:03 gofabian

working script for me

npx cobertura-merge -p -o coverage/cobertura-coverage.xml $(find coverage -type f -name 'cobertura-coverage.xml' | awk -v ORS=" " -v OFS="" '{ print "package", NR, "=", $0 }')

find coverage -type f -name 'cobertura-coverage.xml' | awk -v ORS=" " -v OFS="" '{ print "package", NR, "=", $0 }'

package1=coverage/apps/app1/cobertura-coverage.xml package2=coverage/apps/app2/cobertura-coverage.xml
package3=coverage/libs/app3/cobertura-coverage.xml

bartoszgolebiowski avatar Aug 28 '24 08:08 bartoszgolebiowski