Skip to content

Commit 2fc2b7a

Browse files
committed
Make test resource config override dev service config (and system properties)
1 parent 4745e81 commit 2fc2b7a

File tree

6 files changed

+5
-13
lines changed

6 files changed

+5
-13
lines changed

core/deployment/src/main/java/io/quarkus/deployment/builditem/DevServicesResultBuildItem.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ public Map<String, Function<Startable, String>> getApplicationConfigProvider() {
174174

175175
public Map<String, String> getConfig(Startable startable) {
176176
SupplierMap<String, String> map = new SupplierMap<>();
177-
if (config != null && !config.isEmpty()) {
178-
map.putAll(config);
179-
}
180177
for (Map.Entry<String, Function<Startable, String>> entry : applicationConfigProvider.entrySet()) {
181178
map.put(entry.getKey(), () -> entry.getValue().apply(startable));
182179
}

core/runtime/src/main/java/io/quarkus/devservice/runtime/config/DevServicesConfigBuilder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ public SmallRyeConfigBuilder configBuilder(SmallRyeConfigBuilder builder) {
1414

1515
@Override
1616
public int priority() {
17-
// What's the right priority? This is a cheeky dynamic override, so a high priority seems correct, but dev services are supposed to fill in gaps in existing information.
18-
// Dev services should be looking at those sources and not doing anything if there's existing config,
19-
// so a very low priority is also arguably correct.
20-
// In principle the priority actually shouldn't matter much, but in practice it needs to not be higher than Arquillian config overrides or some tests fail
21-
2217
return 10;
2318
}
2419
}

core/runtime/src/main/java/io/quarkus/devservice/runtime/config/DevServicesConfigSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public String getName() {
5656

5757
@Override
5858
public int getOrdinal() {
59-
// See discussion on DevServicesConfigBuilder about what the right value here is
60-
return 10;
59+
// This is a dynamic override, so it needs a high priority to be able to override ephemeral port (0) with real values
60+
return 410; // a bit more than system properties, but less than the TestResource config overrides done via RuntimeOverrideConfigSource
6161
}
6262
}

core/runtime/src/main/java/io/quarkus/runtime/configuration/RuntimeOverrideConfigSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public Set<String> getPropertyNames() {
4949

5050
@Override
5151
public int getOrdinal() {
52-
return 399; //one less that system properties
52+
return 420; // higher than dev services config source
5353
}
5454

5555
@Override

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/EffectiveConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ private EffectiveConfig(Builder builder) {
4949
// (see also https://quarkus.io/guides/config-reference#configuration-sources)
5050
// 600 -> forcedProperties
5151
// 500 -> taskProperties
52+
// 420 -> RuntimeOverride (used by TestResource and other Startup actions)
53+
// 410 -> Dev Service overrides
5254
// 400 -> System.getProperties() (provided by default sources)
5355
// 300 -> System.getenv() (provided by default sources)
5456
// 290 -> quarkusBuildProperties

integration-tests/amazon-lambda/src/test/java/io/quarkus/it/amazon/lambda/AmazonLambdaEphemeralPortTestCase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
import static io.restassured.RestAssured.given;
44
import static org.hamcrest.CoreMatchers.containsString;
55

6-
import org.junit.jupiter.api.Disabled;
76
import org.junit.jupiter.api.Test;
87

98
import io.quarkus.it.amazon.lambda.profiles.EphemeralPortProfile;
109
import io.quarkus.test.junit.QuarkusTest;
1110
import io.quarkus.test.junit.TestProfile;
1211

13-
@Disabled("Tracked by https://github.com/quarkusio/quarkus/issues/48784")
1412
@TestProfile(EphemeralPortProfile.class)
1513
@QuarkusTest
1614
public class AmazonLambdaEphemeralPortTestCase {

0 commit comments

Comments
 (0)