Run the CpuAffinity JVM tests in the Android workflow

Open Beginner friendly
#23 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
android, github-actions, kotlin
Domain
ci-cd, testing

Research direction

Read .github/workflows/android.yml and the existing JVM test steps, then inspect CpuAffinity.kt and CpuAffinityTest.kt to confirm the Gradle task. Run ./gradlew :hermit-notifications:testDebugUnitTest from apps/mobile/android, then add that task as one workflow step after the approval prompt test. Done when the new step passes the four tests and no other workflow content changes.

Written by the indexing model from the issue text.

Description

help wanted

Why

CpuAffinity.kt reads which cores Android lets Hermit use; the device-adaptive runtime plans the model's threads from it, and the Device lab reports it as allowedCpus. Its JVM tests exist, but no CI job runs them (ROADMAP.md, Now: the Device lab).

What to do

Today .github/workflows/android.yml runs the JVM tests of hermit-autofill and hermit-approval-key only.

  1. Read apps/mobile/modules/hermit-notifications/android/src/main/java/io/dojocoding/hermit/notifications/CpuAffinity.kt and its test, apps/mobile/modules/hermit-notifications/android/src/test/java/io/dojocoding/hermit/notifications/CpuAffinityTest.kt. apps/mobile/modules/hermit-notifications/android/build.gradle already declares JUnit for it.

  2. Build the app once as CONTRIBUTING.md says in "Build the Android app", then run the tests on your machine:

    (cd apps/mobile/android && ./gradlew :hermit-notifications:testDebugUnitTest)
    

    The name follows the two existing steps. If Gradle doesn't know it, ./gradlew projects lists the real one.

  3. In android.yml, add one step after "Approval prompt text from the signed payload on the JVM" that runs the same task with --no-daemon, in apps/mobile/android, named in the same style, for example "Allowed cores from Cpus_allowed_list on the JVM".

Done when

  • The Android workflow on your pull request runs the new step, and it passes with the four tests in CpuAffinityTest.
  • Nothing else in the workflow changes.

How to check

  • On your machine: the Gradle command above ends with BUILD SUCCESSFUL.
  • On GitHub: the Android workflow runs for pull requests that are ready for review (not drafts) and that touch apps/mobile/** or the workflow file. Mark yours ready once the step is in.

Keep in mind

  • AGENTS.md says to leave CI workflows alone unless the issue is about them. This one is: change only this step.
  • Keep actions pinned to commit SHAs and the token read-only. Add no secret and no permission.
  • Don't change CpuAffinity.kt here. If a test fails, open a bug report with what you saw.
Dominant language
TypeScript
Stars
11
Forks
0
Avg merge
10m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DojoCodingLabs/hermit

All issues in DojoCodingLabs/hermit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.