Skip to content

Exclude the loopback HTTP server test from the animalsniffer check - #118

Merged
pjfanning merged 1 commit into
apache:trunkfrom
pjfanning:build-animalsniffer-exclude-httpserver
Sep 7, 2026
Merged

Exclude the loopback HTTP server test from the animalsniffer check#118
pjfanning merged 1 commit into
apache:trunkfrom
pjfanning:build-animalsniffer-exclude-httpserver

Conversation

@pjfanning

Copy link
Copy Markdown
Member

ParseUrlRedirectTest, added in #113, starts a com.sun.net.httpserver server on loopback to pin redirect following in SchemaTypeLoaderBase.parse(URL). That package is not part of the Android API signature (gummy-bears-api-${androidSdkMinimum}) animalsniffer checks against, so animalsnifferTest reports 19 undefined references and ./gradlew check fails on trunk:

> 19 AnimalSniffer violations were found in 1 files.
org.apache.xmlbeans.impl.schema.ParseUrlRedirectTest:38  Undefined reference: com.sun.net.httpserver.HttpServer com.sun.net.httpserver.HttpServer.create(...)
...

My fault — I added that test without running check. Apologies for the breakage.

The signature describes what the published artifact may use. Test code never ships and never runs on Android, so this excludes the one file rather than weakening the signature for main:

animalsnifferTest {
    exclude '**/ParseUrlRedirectTest*'
}

Excluding the whole test source set would also work — the animalsniffer block already carries a commented-out sourceSets = [sourceSets.main] for exactly that — but this keeps the rest of the tests covered. Happy to switch to the broader form if you'd prefer it.

./gradlew animalsnifferTest animalsnifferMain passes; the task still runs, with only that file filtered out.

🤖 Generated with Claude Code

ParseUrlRedirectTest (added in apache#113) starts a com.sun.net.httpserver server on
loopback to pin redirect following. That package is not in the Android API
signature animalsniffer checks against, so animalsnifferTest reports 19
undefined references and ./gradlew check fails.

The signature describes what the published artifact may use. Test code never
ships and never runs on Android, so exclude just this file rather than weaken
the signature for main. Excluding the whole test source set would also work -
the animalsniffer block already carries a commented-out
"sourceSets = [sourceSets.main]" for that - but this keeps the rest of the
tests covered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pjfanning
pjfanning merged commit 9a9bb48 into apache:trunk Sep 7, 2026
3 checks passed
@pjfanning
pjfanning deleted the build-animalsniffer-exclude-httpserver branch September 7, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant