Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverageAggregate does not working properly with Cross-building #315

Open
angelcervera opened this issue Oct 10, 2020 · 1 comment
Open

Comments

@angelcervera
Copy link

coverageAggregate ignores cross-building versions.

This code does not aggregate reports:

$ sbt clean "++2.13.3 test"
$ find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./module2/target/scala-2.13/scoverage-data/scoverage.coverage
./core/target/scala-2.13/scoverage-data/scoverage.coverage
./module1/target/scala-2.13/scoverage-data/scoverage.coverage
$ # Next is not working
$ sbt "++2.13.3 coverageAggregate"
 find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./module2/target/scala-2.13/coverage-report/cobertura.xml
./module2/target/scala-2.13/scoverage-data/scoverage.coverage
./core/target/scala-2.13/coverage-report/cobertura.xml
./core/target/scala-2.13/scoverage-data/scoverage.coverage
./module1/target/scala-2.13/coverage-report/cobertura.xml
./module1/target/scala-2.13/scoverage-data/scoverage.coverage
$ # Neither next ...
$ sbt coverageAggregate
 find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./module2/target/scala-2.13/coverage-report/cobertura.xml
./module2/target/scala-2.13/scoverage-data/scoverage.coverage
./core/target/scala-2.13/coverage-report/cobertura.xml
./core/target/scala-2.13/scoverage-data/scoverage.coverage
./module1/target/scala-2.13/coverage-report/cobertura.xml
./module1/target/scala-2.13/scoverage-data/scoverage.coverage

I expected reports aggregated at ./target/scala-2.13/coverage-report/cobertura.xml

Using the default scala version, it works only if the Scala version is not specified.:

$ sbt clean "++2.12.2 test"
$ find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./moduleOnly212/target/scala-2.12/scoverage-data/scoverage.coverage
./module2/target/scala-2.12/scoverage-data/scoverage.coverage
./core/target/scala-2.12/scoverage-data/scoverage.coverage
./module1/target/scala-2.12/scoverage-data/scoverage.coverage
$ # Next is not working
$ sbt "++2.12.2 coverageAggregate"
$ find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./moduleOnly212/target/scala-2.12/coverage-report/cobertura.xml
./moduleOnly212/target/scala-2.12/scoverage-data/scoverage.coverage
./module2/target/scala-2.12/coverage-report/cobertura.xml
./module2/target/scala-2.12/scoverage-data/scoverage.coverage
./core/target/scala-2.12/coverage-report/cobertura.xml
./core/target/scala-2.12/scoverage-data/scoverage.coverage
./module1/target/scala-2.12/coverage-report/cobertura.xml
./module1/target/scala-2.12/scoverage-data/scoverage.coverage
$ # But excluding the version and using the default one, works:
$ sbt coverageAggregate
$ find . -type f \( -name scoverage.coverage -o -name cobertura.xml \)
./moduleOnly212/target/scala-2.12/coverage-report/cobertura.xml
./moduleOnly212/target/scala-2.12/scoverage-data/scoverage.coverage
./module2/target/scala-2.12/coverage-report/cobertura.xml
./module2/target/scala-2.12/scoverage-data/scoverage.coverage
./target/scala-2.12/coverage-report/cobertura.xml
./core/target/scala-2.12/coverage-report/cobertura.xml
./core/target/scala-2.12/scoverage-data/scoverage.coverage
./module1/target/scala-2.12/coverage-report/cobertura.xml
./module1/target/scala-2.12/scoverage-data/scoverage.coverage

Versions:
sbt 1.3.13
sbt-scoverage 1.6.1

The full example at https://github.com/angelcervera/sbt-multimodule-template

@arvkonstantin
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants