test: retire four test profiles that only restate configured defaults (#4328)

Quarkus builds the application once per distinct @TestProfile class, so a
profile whose overrides are already the configured test values costs a
full augmentation and changes nothing about how the class runs.

Two classes had a profile that was inert end to end, and now run on the
default profile alongside every one of their siblings:

  CloudTrailAdvancedSelectorsIntegrationTest set
  cloudtrail.flush-interval-seconds to the hour it already is. Delivery
  is driven through CloudTrailLogWriter.flushNow(), its buckets and
  trails carry random suffixes, and its assertions match on those names.

  StepFunctionsEcsRunTaskIntegrationTest set ecs.mock to the true it
  already is. Its cluster and task-family names appear nowhere else in
  the suite.

Two more collapse into a shared profile:

  S3PresignedPostIamOnlyEnforcementIntegrationTest additionally set
  s3.enforce-auth to false, the configured default, which its own
  javadoc calls out as the default. It now uses the shared
  IamEnforcementProfile, the same one as the presigned-URL class its
  javadoc names as the case it mirrors.

  CurDailyEmissionAccountIsolationIntegrationTest and
  ParquetEmitterIntegrationTest both reduce to pinning the HTTP port:
  floci.base-url already carries the same value, and
  CurEmissionScheduler acts only on emit-mode daily or synchronous, so
  every other value is inert. They share FixedPortNoEmissionProfile,
  which keeps the emit-mode entries so the assumption stays visible.

Each retired profile carried an assumption worth keeping, so those moved
into the class javadoc rather than disappearing with the profile.

Distinct test profiles across src/test/java drop from 83 to 79.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-24 17:37:54 -05:00
1 parent 70df224189
commit f6f5eda0be
6 files changed
+42 -79

No files matched your search

@@ -2,13 +2,10 @@ package io.github.hectorvent.floci.services.cloudtrail;
import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.UUID;
import static io.restassured.RestAssured.given;
@@ -22,9 +19,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* This is the reproduction case for the CloudTrail circular-logging cost problem: excluding the
* trail's own destination bucket via {@code resources.ARN notStartsWith} stops the trail from
* recording its own delivery writes.
*
* <p>Delivery is driven explicitly through {@link CloudTrailLogWriter#flushNow()} rather than by
* the background flush, which the configured {@code cloudtrail.flush-interval-seconds} of an hour
* keeps out of the way. Every bucket and trail name here carries a random suffix and the
* assertions match on those names, so the class does not need an application of its own.
*/
@QuarkusTest
@TestProfile(CloudTrailAdvancedSelectorsIntegrationTest.IsolatedProfile.class)
class CloudTrailAdvancedSelectorsIntegrationTest {
private static final String CT_TARGET = "CloudTrail_20131101.";
@@ -33,13 +34,6 @@ class CloudTrailAdvancedSelectorsIntegrationTest {
@Inject
CloudTrailLogWriter writer;
public static final class IsolatedProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.services.cloudtrail.flush-interval-seconds", "3600");
}
}
@BeforeAll
static void configureRestAssured() {
RestAssuredJsonUtils.configureAwsContentTypes();
@@ -1,15 +1,14 @@
package io.github.hectorvent.floci.services.cur;
import io.github.hectorvent.floci.testing.FixedPortNoEmissionProfile;
import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@@ -32,7 +31,7 @@ import static org.hamcrest.Matchers.equalTo;
* {@code NoSuchBucket}.
*/
@QuarkusTest
@TestProfile(CurDailyEmissionAccountIsolationIntegrationTest.DailyProfile.class)
@TestProfile(FixedPortNoEmissionProfile.class)
@EnabledIfEnvironmentVariable(named = "FLOCI_DUCK_CROSS_CONTAINER_TEST", matches = "1|true|yes")
class CurDailyEmissionAccountIsolationIntegrationTest {
@@ -43,21 +42,6 @@ class CurDailyEmissionAccountIsolationIntegrationTest {
private static final String S3_AUTH =
"AWS4-HMAC-SHA256 Credential=" + ACCOUNT_ID + "/20260101/us-east-1/s3/aws4_request";
public static final class DailyProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
Map<String, String> o = new HashMap<>();
o.put("quarkus.http.test-port", "4566");
o.put("floci.base-url", "http://localhost:4566");
// Sync mode is off so the put-report call below does NOT emit
// immediately. The test then drives the scheduler's runDaily
// codepath directly via the engine to simulate the daily tick.
o.put("floci.services.cur.emit-mode", "off");
o.put("floci.services.bcm-data-exports.emit-mode", "off");
return o;
}
}
@BeforeAll
static void configureRestAssured() {
RestAssuredJsonUtils.configureAwsContentTypes();
@@ -3,15 +3,13 @@ package io.github.hectorvent.floci.services.cur;
import io.github.hectorvent.floci.core.common.UsageLine;
import io.github.hectorvent.floci.services.floci.duck.FlociDuckClient;
import io.github.hectorvent.floci.services.s3.S3Service;
import io.github.hectorvent.floci.testing.FixedPortNoEmissionProfile;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import java.util.HashMap;
import java.time.Instant;
import java.util.List;
import java.util.Map;
@@ -46,27 +44,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* runner that adds the host alias).
*/
@QuarkusTest
@TestProfile(ParquetEmitterIntegrationTest.FixedPortProfile.class)
@TestProfile(FixedPortNoEmissionProfile.class)
@EnabledIfEnvironmentVariable(named = "FLOCI_DUCK_CROSS_CONTAINER_TEST", matches = "1|true|yes")
class ParquetEmitterIntegrationTest {
/**
* Force Floci's HTTP server onto a known port so the floci-duck sidecar can
* reach it via {@code host.docker.internal:<port>}. The default test port
* of {@code 0} (random) is fine for tests that only hit the JVM-local API,
* but DuckDB writes Parquet by talking back to Floci's S3 service over the
* network and so needs a stable port.
*/
public static final class FixedPortProfile implements QuarkusTestProfile {
@Override
public java.util.Map<String, String> getConfigOverrides() {
java.util.Map<String, String> overrides = new HashMap<>();
overrides.put("quarkus.http.test-port", "4566");
overrides.put("floci.base-url", "http://localhost:4566");
return overrides;
}
}
private static final Instant JAN_15 = Instant.parse("2026-01-15T00:00:00Z");
private static final Instant JAN_16 = Instant.parse("2026-01-16T00:00:00Z");
@@ -1,7 +1,7 @@
package io.github.hectorvent.floci.services.s3;
import io.github.hectorvent.floci.testing.IamEnforcementProfile;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import org.junit.jupiter.api.Test;
@@ -9,7 +9,6 @@ import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.UUID;
import static io.restassured.RestAssured.given;
@@ -27,7 +26,7 @@ import static org.hamcrest.Matchers.equalTo;
* {@code S3PresignedPostAuthEnforcementIntegrationTest} cannot exercise.
*/
@QuarkusTest
@TestProfile(S3PresignedPostIamOnlyEnforcementIntegrationTest.IamOnlyProfile.class)
@TestProfile(IamEnforcementProfile.class)
class S3PresignedPostIamOnlyEnforcementIntegrationTest {
private static final String REGION = "us-east-1";
@@ -209,13 +208,4 @@ class S3PresignedPostIamOnlyEnforcementIntegrationTest {
return "AWS4-HMAC-SHA256 Credential=" + accessKeyId + "/" + amzDate + "/" + REGION + "/" + service
+ "/aws4_request, SignedHeaders=host, Signature=abc";
}
public static final class IamOnlyProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of(
"floci.services.iam.enforcement-enabled", "true",
"floci.services.s3.enforce-auth", "false");
}
}
}
@@ -4,8 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.hectorvent.floci.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;
import org.junit.jupiter.api.MethodOrderer;
@@ -13,8 +11,6 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import java.util.Map;
import static io.restassured.RestAssured.given;
import static org.junit.jupiter.api.Assertions.*;
@@ -28,24 +24,15 @@ import static org.junit.jupiter.api.Assertions.*;
* happy-path container-execution {@code .sync} poll-to-STOPPED is exercised empirically
* against a live emulator with Docker available (it is not asserted here, to keep the
* unit suite independent of a container runtime / image registry).
*
* <p>That works because ECS runs in mock mode, so {@code RunTask} moves a task to RUNNING with no
* container runtime behind it. Mock mode is the configured test default rather than something this
* class turns on, which is why it needs no profile of its own.
*/
@QuarkusTest
@TestProfile(StepFunctionsEcsRunTaskIntegrationTest.EcsMockProfile.class)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class StepFunctionsEcsRunTaskIntegrationTest {
/**
* Runs ECS in mock mode so RunTask transitions tasks to RUNNING without a container
* runtime. These tests assert only the Step Functions↔ECS wiring (routing, casing,
* validation, error propagation), which is independent of real container execution.
*/
public static final class EcsMockProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.services.ecs.mock", "true");
}
}
private static final String SFN_CONTENT_TYPE = "application/x-amz-json-1.0";
private static final String ECS_CONTENT_TYPE = "application/x-amz-json-1.1";
private static final String ECS_TARGET_PREFIX = "AmazonEC2ContainerServiceV20141113.";
@@ -0,0 +1,27 @@
package io.github.hectorvent.floci.testing;
import io.quarkus.test.junit.QuarkusTestProfile;
import java.util.Map;
/**
* Pins the Floci HTTP port so the DuckDB sidecar can reach Floci S3 over the network, and names
* both billing emitters as off so a report is only written when the test drives the emitter
* itself. {@code CurEmissionScheduler} acts only on {@code daily} and {@code synchronous}, so
* every other value leaves the emitters idle; the configured test default already resolves to one
* of those inert values, and spelling it out here keeps the assumption visible.
*
* <p>Quarkus builds the application once per distinct profile class, so the classes that need this
* share one profile rather than each declaring their own.
*/
public class FixedPortNoEmissionProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of(
"quarkus.http.test-port", "4566",
"floci.base-url", "http://localhost:4566",
"floci.services.cur.emit-mode", "off",
"floci.services.bcm-data-exports.emit-mode", "off");
}
}