test: fold the Service Quotas applied-value profile into IndependentServiceSettingsProfile (#8834)

Quarkus builds one application per distinct test profile at discovery and keeps
each for the rest of the surefire JVM, so every profile a shard holds costs heap.
ServiceQuotasAppliedValueIntegrationTest's nested profile sets the applied
standard On-Demand vCPU quota, which only Service Quotas reports and EC2 only
enforces with enforce-vcpu-quotas on, so it now shares
IndependentServiceSettingsProfile, whose rule is one class per service setting.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-18 02:04:53 -04:00
1 parent 7fb37956be
commit 07996b0ede
2 files changed
+15 -13

No files matched your search

@@ -1,8 +1,8 @@
package io.floci.aws.services.servicequotas;
import io.floci.aws.testing.IndependentServiceSettingsProfile;
import io.floci.aws.testing.RestAssuredJsonUtils;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import io.restassured.response.Response;
import org.junit.jupiter.api.BeforeAll;
@@ -10,7 +10,6 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import java.util.List;
import java.util.Map;
import static io.floci.aws.testing.EnforcementFixtures.auth;
import static io.restassured.RestAssured.given;
@@ -18,19 +17,16 @@ import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* GetServiceQuota reports a configured applied value. The value, 7, comes from
* {@link IndependentServiceSettingsProfile}.
*/
@QuarkusTest
@TestProfile(ServiceQuotasAppliedValueIntegrationTest.AppliedQuotaProfile.class)
@TestProfile(IndependentServiceSettingsProfile.class)
class ServiceQuotasAppliedValueIntegrationTest {
private static final String CODE = "L-1216C47A";
public static class AppliedQuotaProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.services.servicequotas.standard-on-demand-vcpus", "7");
}
}
@BeforeAll
static void configureContentTypes() {
RestAssuredJsonUtils.configureAwsContentTypes();
@@ -68,6 +68,11 @@ import java.util.Map;
* supported wire protocol claims, and leaves REST and well-formed RPC traffic untouched.
* {@code StrictProtocolClaimingIntegrationTest} and {@code SwfLegacyProtocolIntegrationTest} rely
* on it.</li>
* <li>{@code floci.services.servicequotas.standard-on-demand-vcpus=7} is what GetServiceQuota
* reports as the applied value of the standard On-Demand vCPU quota.
* {@code ServiceQuotasAppliedValueIntegrationTest} relies on it. EC2 only enforces that quota
* when {@code floci.services.ec2.enforce-vcpu-quotas} is on, which it is not here, so
* {@code Ec2VolumeBlockDeviceDockerIntegrationTest}'s instances never meet it.</li>
* </ul>
*
* <p>Each override is inert for the other classes. Each one is read by a single service: the
@@ -75,8 +80,8 @@ import java.util.Map;
* Neptune cluster creation, Route53 VPC association and authorization, CloudFront origin fetches,
* Cognito app client validation, the Scheduler dispatcher, the RDS Data API and Aurora auto-pause,
* Firehose delivery, the Lambda runtime image resolver, the IoT MQTT broker, EC2, SageMaker
* training jobs, Bedrock Runtime and ElastiCache. Each class is the only one here that calls its
* service, so no override reaches another class. Strict claiming is read for every request, but
* training jobs, Bedrock Runtime, ElastiCache and Service Quotas. Each class is the only one here
* that calls its service, so no override reaches another class. Strict claiming is read for every request, but
* only changes the answer to an RPC-signaled request no protocol claims, which only the two
* protocol classes send. Route53 and RDS do look VPCs and subnets up in EC2, but only
* read what EC2 has stored, which does not change with EC2 mocked or not.
@@ -121,7 +126,8 @@ public class IndependentServiceSettingsProfile implements QuarkusTestProfile {
Map.entry("floci.services.bedrock-runtime.proxy.url", "not a valid url"),
Map.entry("floci.services.bedrock-runtime.proxy.passthrough", "true"),
Map.entry("floci.services.elasticache.shell-less-backend", "true"),
Map.entry("floci.protocols.strict-claiming", "true")));
Map.entry("floci.protocols.strict-claiming", "true"),
Map.entry("floci.services.servicequotas.standard-on-demand-vcpus", "7")));
overrides.putAll(new YamlConfigSource("runtime-images", """
floci:
services: