Repository navigation
feat: testCompileSafety option to skip compile safety in test compilations - #118
Open
shreknitin89 wants to merge 1 commit into
Open
shreknitin89 wants to merge 1 commit into
shreknitin89 wants to merge 1 commit into
Conversation
…tions Since 1.1.0 every startKoin/koinApplication call is a full-graph entry point, including those in test sources, which usually assemble a partial graph of the module under test plus mocks. Their entry points then report KOIN-W001/D001/D003 for bindings the test never needs. testCompileSafety (default true, unchanged behaviour) lets a build keep full-graph validation on main compilations and turn it off for test compilations. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
shreknitin89
force-pushed
the
feat/test-compile-safety-opt-out
branch
from
September 29, 2026 00:40
fad7f6f to
6ef1167
Compare
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 1.1.0, full-graph validation runs at every
startKoin/koinApplicationentry point, and there's no way to scope that by compilation. Test sources are full of entry points, and a unit test typically loads a deliberately partial graph: the module under test plus a few mocks. In our multi-module Android app, 12 unit-test compilations fail with about 52 diagnostics underallWarningsAsErrors(KOIN-W001modules not loaded,KOIN-D001/KOIN-D003for mocked dependencies,KOIN-W003for helper-built lists), while the production graphs compile clean. The only switch today iscompileSafety = falsefor the whole Gradle module, which also turns off validation of the production graph.Change
Adds
koinCompiler { testCompileSafety = false }. The default istrue, so existing behavior is unchanged. When it'sfalse, test compilations getcompileSafety=false, and main compilations keep whatevercompileSafetysays. A compilation counts as a test compilation when its name istestor ends inTest(jvmTest,debugUnitTest,debugAndroidTest).Testing
With this change (on top of #116) built locally as
1.2.1-localandtestCompileSafety = false:forge-appand the legacy app module keep full-graph validation (dropping a module fromstartKoinfails with 545KOIN-D001s on a non-incremental compile), and every unit-test compilation in the repo compiles clean. There are no Gradle-plugin tests upstream to extend. I'm happy to add a TestKit test if you'd like one.🤖 Generated with Claude Code