Skip to content

Commit 13cf87e

Browse files
nficanoclaude
andcommitted
build: wire JaCoCo coverage reports + spotless cleanup
Apply the jacoco plugin to every java-library subproject so every test task is finalized by jacocoTestReport with XML and HTML output. Coverage threshold enforcement (#33 80% target) is left as follow-up — the plumbing is in place so further test additions raise the headline number incrementally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a750b8f commit 13cf87e

7 files changed

Lines changed: 22 additions & 23 deletions

File tree

arcp-client/src/main/java/dev/arcp/client/ArcpClient.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static EnumSet<Feature> safeFeatureCopy(Set<Feature> features) {
9999
new ConcurrentHashMap<>();
100100
private final ConcurrentHashMap<JobId, ExecutorService> liveExecutors = new ConcurrentHashMap<>();
101101
private final boolean ownedScheduler;
102+
102103
// Reserved for future use by tests asserting FIFO insertion order of pending submits.
103104
@SuppressWarnings("unused")
104105
private final ConcurrentLinkedDeque<MessageId> pendingSubmitOrder = new ConcurrentLinkedDeque<>();
@@ -127,8 +128,7 @@ private ArcpClient(Builder b) {
127128
this.scheduler =
128129
Executors.newScheduledThreadPool(
129130
1,
130-
r ->
131-
Thread.ofPlatform().name("arcp-client-scheduler", 0).daemon(true).unstarted(r));
131+
r -> Thread.ofPlatform().name("arcp-client-scheduler", 0).daemon(true).unstarted(r));
132132
this.ownedScheduler = true;
133133
}
134134
this.resumeToken = b.resumeToken;
@@ -256,13 +256,7 @@ public void unsubscribe(JobId jobId) {
256256
}
257257
if (!closed) {
258258
try {
259-
send(
260-
Message.Type.JOB_UNSUBSCRIBE,
261-
new JobUnsubscribe(jobId),
262-
sessionId,
263-
null,
264-
jobId,
265-
null);
259+
send(Message.Type.JOB_UNSUBSCRIBE, new JobUnsubscribe(jobId), sessionId, null, jobId, null);
266260
} catch (RuntimeException ignored) {
267261
// best-effort
268262
}
@@ -379,7 +373,8 @@ private void failAll(Throwable cause) {
379373
o.events.close();
380374
}
381375
outstanding.clear();
382-
for (java.util.Map.Entry<MessageId, CompletableFuture<SessionJobs>> e : listRequests.entrySet()) {
376+
for (java.util.Map.Entry<MessageId, CompletableFuture<SessionJobs>> e :
377+
listRequests.entrySet()) {
383378
if (!e.getValue().isDone()) {
384379
e.getValue().completeExceptionally(cause);
385380
}

arcp-core/src/main/java/dev/arcp/core/wire/ArcpMapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ public static ObjectMapper create() {
3636
/**
3737
* Shared mapper for hot-path use.
3838
*
39-
* Treat this instance as read-only. Reconfiguring the shared mapper can
40-
* affect unrelated callers because the same ObjectMapper is reused across
41-
* the SDK.
39+
* <p>Treat this instance as read-only. Reconfiguring the shared mapper can affect unrelated
40+
* callers because the same ObjectMapper is reused across the SDK.
4241
*/
4342
public static ObjectMapper shared() {
4443
return SHARED;

arcp-runtime/src/main/java/dev/arcp/runtime/ArcpRuntime.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ private ArcpRuntime(Builder b) {
8484
this.scheduler =
8585
Executors.newScheduledThreadPool(
8686
1,
87-
r ->
88-
Thread.ofPlatform()
89-
.name("arcp-runtime-scheduler", 0)
90-
.daemon(true)
91-
.unstarted(r));
87+
r -> Thread.ofPlatform().name("arcp-runtime-scheduler", 0).daemon(true).unstarted(r));
9288
this.ownedScheduler = true;
9389
}
9490
this.runtimeName = b.runtimeName;

arcp-runtime/src/main/java/dev/arcp/runtime/credentials/CredentialBinding.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ private void revoke(IssuedCredential credential) {
9191
} catch (CompletionException e) {
9292
Throwable cause = e.getCause() != null ? e.getCause() : e;
9393
if (attempt == MAX_REVOKE_ATTEMPTS) {
94-
log.warn(
95-
"credential revoke failed after {} attempts for {}", attempt, id, cause);
94+
log.warn("credential revoke failed after {} attempts for {}", attempt, id, cause);
9695
store.markRevocationFailed(id, cause);
9796
return;
9897
}

arcp-runtime/src/main/java/dev/arcp/runtime/idempotency/IdempotencyStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public boolean matchesPayload(Principal principal, String idempotencyKey, String
9292

9393
/**
9494
* Evict entries older than {@code ttl}. Exposed for deterministic test control; the scheduled
95-
* background task invokes this method automatically when a scheduler was supplied at
96-
* construction time.
95+
* background task invokes this method automatically when a scheduler was supplied at construction
96+
* time.
9797
*/
9898
public void prune() {
9999
Instant now = clock.instant();

arcp-runtime/src/main/java/dev/arcp/runtime/session/SessionLoop.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ private void handleSubscribe(JobSubscribe sub) {
798798
return;
799799
}
800800
boolean alreadySubscribed =
801-
rec.subscribers().stream().anyMatch(s -> s.session() == this && s.jobId().equals(rec.jobId()));
801+
rec.subscribers().stream()
802+
.anyMatch(s -> s.session() == this && s.jobId().equals(rec.jobId()));
802803
if (!alreadySubscribed) {
803804
rec.addSubscriber(new JobRecord.Subscriber(this, rec.jobId()));
804805
}

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ allprojects {
1313

1414
subprojects {
1515
plugins.withId("java-library") {
16+
apply(plugin = "jacoco")
1617
extensions.configure<JavaPluginExtension> {
1718
toolchain {
1819
languageVersion.set(JavaLanguageVersion.of(21))
@@ -34,6 +35,14 @@ subprojects {
3435
}
3536
tasks.withType<Test>().configureEach {
3637
useJUnitPlatform()
38+
finalizedBy("jacocoTestReport")
39+
}
40+
tasks.withType<JacocoReport>().configureEach {
41+
dependsOn("test")
42+
reports {
43+
xml.required.set(true)
44+
html.required.set(true)
45+
}
3746
}
3847
tasks.withType<Javadoc>().configureEach {
3948
(options as? StandardJavadocDocletOptions)?.apply {

0 commit comments

Comments
 (0)