Skip to content

Conversation

@aloubyansky
Copy link
Member

Fixes #8845
Fixes #8901

@boring-cyborg boring-cyborg bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Apr 28, 2020
@aloubyansky
Copy link
Member Author

Hm, I noticed a difference in how I implemented this for Gradle vs how it seems to work for Maven currently.
In Maven, application.properties from the test resources dir seems to replace the main application.properties.
While in Gradle (in this PR) application.properties from the test resources is added a dominating config source.
So, we need to decide what's more appropriate. I tend to prefer the way it's implemented in this PR. However, it'll be a breaking change.

@aloubyansky
Copy link
Member Author

I should probably re-work it so the main application.properties is completely replaced with the one from the test. Partial overrides are supported using profiles.

@aloubyansky aloubyansky changed the title Gradle: inject test resources before the main resources for testing WIP Gradle: inject test resources before the main resources for testing Apr 28, 2020
@aloubyansky aloubyansky force-pushed the gradle-inject-test-tesources branch from d1367e0 to 805c876 Compare April 29, 2020 16:03
@aloubyansky aloubyansky changed the title WIP Gradle: inject test resources before the main resources for testing Gradle: inject test resources before the main resources for testing Apr 29, 2020
@aloubyansky
Copy link
Member Author

Ok, I've re-worked it to replace the main application.properties

@aloubyansky aloubyansky force-pushed the gradle-inject-test-tesources branch from 805c876 to 8f9bcec Compare April 30, 2020 09:08
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mklueh
Copy link
Contributor

mklueh commented May 15, 2020

Does that mean it'll replace the entire file contents so you have to have your whole production application properties duplicated if you just want to change one single property for your tests? I was always under the impression that it is kind of merged and the test properties that are defined will overwrite those that are given in the main application.properties

@aloubyansky
Copy link
Member Author

Yes, it is completely replaced. We thought that with profiles you already have a way to override properties selectively. And it is also consistent with how it works in Maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/testing

Projects

None yet

4 participants