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

quarkus.jacoco.excludes doesn't work since 3.17.0 #44811

Closed
waldmaier opened this issue Nov 28, 2024 · 14 comments · Fixed by #44838
Closed

quarkus.jacoco.excludes doesn't work since 3.17.0 #44811

waldmaier opened this issue Nov 28, 2024 · 14 comments · Fixed by #44838
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@waldmaier
Copy link

waldmaier commented Nov 28, 2024

Describe the bug

quarkus:
  jacoco:
     excludes:
       -  "**/xsdgen1/**/*"
       -  "**/xsdgen2/**/*"

does not take effect by creating jacoco report

Expected behavior

exclude subdirectories listed in yaml config

Actual behavior

generated classes excluded in yaml are in the code coverage calculation

How to Reproduce?

mvn clean test

look into jacoco report

Output of uname -a or ver

Windows 10

Output of java -version

21

Quarkus version or git rev

3.17.0

Build tool (ie. output of mvnw --version or gradlew --version)

maven 3.9.9

Additional information

No response

@waldmaier waldmaier added the kind/bug Something isn't working label Nov 28, 2024
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Nov 28, 2024
@geoand
Copy link
Contributor

geoand commented Nov 28, 2024

Can you please attach a sample that worked in previous versions and doesn't in 3.17?

Thanks

@geoand geoand added the triage/needs-reproducer We are waiting for a reproducer. label Nov 28, 2024
@waldmaier
Copy link
Author

Hi @geoand i am preparing a pet project and i noticed, that when using application.properties then it works, but if you use applicaton.yaml the it is not working. Seems to be an issue of quarkus yaml config

@geoand
Copy link
Contributor

geoand commented Nov 28, 2024

Cool, let me know when you have something

@waldmaier
Copy link
Author

waldmaier commented Nov 28, 2024

@geoand
here are samples: working with 3.16.1 and non working with 3.17.0

Image
Image
tests-with-coverage-quickstart-3-16-1-working.zip
tests-with-coverage-quickstart-3-17-0-non-working.zip

i found out, that if you exchange in application-test.yaml in 3.17.0

quarkus:
  jacoco:
    excludes:
      - "**/xsdgen1/**/*"
      - "**/xsdgen2/**/*"

to

quarkus:
  jacoco:
    excludes: "**/xsdgen1/**/*,**/xsdgen2/**/*"

than it works again

Seems, that yaml extension in 3.17.0 handles yaml arrays on different way than 3.16.1

@geoand
Copy link
Contributor

geoand commented Nov 28, 2024

Interesting, thanks.

@radcortez does that ring a bell?

@radcortez
Copy link
Member

Yes, caused by this: smallrye/smallrye-config#1203, which we did to reduce some allocs.

This shouldn't be required, because to populate a Collection one must use Config.getValues(name, itemType), but apparently old roots use Config.getValue(name, converter) with a clever converter layering to construct the Collection.

As a workaround, one can use the already found solution described in the issue or downgrade io.smallrye.config:smallrye-config-source-yaml to 3.9.1, which is compatible.

I'll see what I can do. Sorry for the inconvenience.

@radcortez radcortez added area/config and removed area/testing env/windows Impacts Windows machines triage/needs-reproducer We are waiting for a reproducer. labels Nov 28, 2024
@radcortez radcortez self-assigned this Nov 28, 2024
@geoand
Copy link
Contributor

geoand commented Nov 29, 2024

Thanks for the info @radcortez!

@gsmet
Copy link
Member

gsmet commented Nov 29, 2024

@radcortez so you're saying it would be fixed if we switched to @ConfigMapping? Maybe we should just do that given that's our plan?

@radcortez
Copy link
Member

Yes, that would fix it for this case. But there may be other root classes that have the same issue.

@gsmet
Copy link
Member

gsmet commented Nov 29, 2024

Yes, what I'm saying is that depending on the complexity of the fix, it might be better to invest this time in migrating more config roots, given that's our ultimate goal.

@radcortez
Copy link
Member

I was thinking of reverting the YAML source change and adding a note only to remove it once we remove all the old roots.

@radcortez
Copy link
Member

Do we agree to proceed with the revert? I did try it, and it reverts to the previous behavior without any additional changes.

I can release a new version of SR Config today and update it to this Tuesday's release.

@geoand
Copy link
Contributor

geoand commented Nov 29, 2024

Yeah, sounds fine to me

@gsmet
Copy link
Member

gsmet commented Nov 29, 2024

Yeah, sure, that would work for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants