Skip to content

Remove duplicate resources from test suite #338

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brian-mcnamara
Copy link
Contributor

See https://github.com/bazel-contrib/rules_jvm/pull/303/files/d899e276ff1a4a9b98272ed6cd31991f09d7839a#r2042301337 for discussion. This change removes library_attrs from the two "classpath healper" libraries (which were introduced as a classpath simplification for bazel), as well as poping the resources from the kwargs if the resources library will include them.

Also added a test case for this

@honnix
Copy link
Contributor

honnix commented Apr 21, 2025

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

@honnix
Copy link
Contributor

honnix commented Apr 21, 2025

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

I know what happened. There are cases we intentionally use a resource named exactly the same as that in production, in order to override. Since -test-lib.jar appears pretty late in classpath (after the production jar), the overridden was not picked up. I think maybe -test-lib.jar should not pack any test resources.

@brian-mcnamara
Copy link
Contributor Author

I think I'm seeing some weird issue when applying this patch. It feels like resources are not picked up.

I know what happened. There are cases we intentionally use a resource named exactly the same as that in production, in order to override. Since -test-lib.jar appears pretty late in classpath (after the production jar), the overridden was not picked up. I think maybe -test-lib.jar should not pack any test resources.

Another solution would be to set library_attributes to not include resources. My thinking is that this would reduce the duplication of resources being added to each jar. Thoughts?

@honnix
Copy link
Contributor

honnix commented Apr 21, 2025

Another solution would be to set library_attributes to not include resources. My thinking is that this would reduce the duplication of resources being added to each jar. Thoughts?

Yeah that was what I suggested, and yes the trade-off is duplicating resources in each every test jar.

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

Successfully merging this pull request may close these issues.

2 participants