run-module-tests

SkillProductivity

Identify and run the correct Gradle test task for a given module based on its source sets and plugin type.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the run-module-tests skill

What this skill tells your AI

The instructions your AI receives, as published by jonapoul/aktual in .claude/skills/run-module-tests/SKILL.md and read by ahel’s review.

Run the correct test task(s) for a Gradle module in this KMP project.

Arguments

  • $ARGUMENTS should be the Gradle module path (e.g., aktual-api, aktual-account:vm, aktual-app:desktop)
    • If omitted, infer it from the most recently discussed or edited module in conversation context

Step-by-Step Process

1. Determine what test source sets exist

Check which test source set directories exist for the module under src/:

src/commonTest/     -> shared tests (run by both androidHostTest and desktopTest tasks)
src/androidHostTest/ -> Android-specific tests (Robolectric, runs on host JVM)
src/desktopTest/    -> JVM/Desktop-specific tests
src/test/           -> Standard JVM test (JVM-only modules)

Use Glob to check: <module-path>/src/*test*/ and <module-path>/src/*Test*/

The module path on disk uses / separators (e.g., aktual-core/api/src/commonTest), but the Gradle path uses : (e.g., :aktual-api).

2. Determine the module type

Check the module's build.gradle.kts for which convention plugin it uses:

PluginModule TypeAvailable Test Tasks
aktual.module.kotlinKMPallTests, testAndroidHostTest, desktopTest
aktual.module.composeKMP + ComposeallTests, testAndroidHostTest, desktopTest
aktual.module.viewmodelKMP + Compose + VMallTests, testAndroidHostTest, desktopTest
aktual.module.diKMP + DIallTests, testAndroidHostTest, desktopTest
aktual.module.jvmJVM-onlytest

3. Choose the right task

For KMP modules (kotlin/compose/viewmodel/di plugins):

Source Sets PresentRecommended TaskWhy
Only commonTesttestAndroidHostTestcommonTest is compiled into both androidHostTest and desktopTest; pick one to avoid running twice. androidHostTest is preferred as it includes Robolectric support.
Only androidHostTest (with or without commonTest)testAndroidHostTestRuns commonTest + androidHostTest together
Only desktopTest (with or without commonTest)desktopTestRuns commonTest + desktopTest together
Both androidHostTest and desktopTestallTestsNeed both targets to cover all tests
commonTest + androidHostTest + desktopTestallTestsNeed both targets

For JVM-only modules (aktual.module.jvm):

  • Always use test

4. Run the test

Execute the Gradle task:

./gradlew :<gradle-module-path>:<task>

For example:

  • ./gradlew :aktual-api:testAndroidHostTest
  • ./gradlew :aktual-account:vm:testAndroidHostTest
  • ./gradlew :aktual-budget:sync:vm:allTests
  • ./gradlew :aktual-app:desktop:test

5. Report results

After running, report:

  • Which task was run and why it was chosen
  • Test results (passed/failed/skipped counts)
  • Any failures with relevant details

Important Notes

  • NEVER run allTests or testAll at the project root level - this runs all tests across all modules and will overload the system
  • When only commonTest exists, prefer testAndroidHostTest over desktopTest since it has Robolectric available for any Android-dependent code
  • The testAll task (defined in ConventionTest.kt) is a convenience alias that depends on all Test-type tasks in the module - equivalent to allTests for KMP modules

Signals

GitHub stars
34
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
run-module-tests
Source
github.com/jonapoul/aktual