Skip to content

test: keep the debug MainActivity labeled and confined as a test harness - #16

Merged
scrimshawlife-ctrl merged 1 commit into
mainfrom
android-harness-label
Oct 7, 2026
Merged

scrimshawlife-ctrl merged 1 commit into
mainfrom
android-harness-label

Conversation

@scrimshawlife-ctrl

Copy link
Copy Markdown
Owner

Board card: "Keep Android dummy MainActivity labeled test harness only" (Backlog, P2; source SUAS-specs REMAINING.md hygiene item 2 and GAP_ANALYSIS.md client leftovers).

What changes

  • MainActivity.kt (debug source set): the banner text moves to internal const val TEST_HARNESS_NOTICE = "TEST HARNESS ONLY: not the product launcher. Product flows live on RootActivity with /api/v0." The only wording change is a colon in place of the em dash.
  • New local unit test app/src/testDebug/.../MainActivityHarnessTest.kt (5 tests, JDK XML parser only, no Robolectric):
    • the notice starts with "TEST HARNESS ONLY", names RootActivity and /api/v0, and has no em dash;
    • the debug manifest keeps MainActivity exported="false" with no intent filter;
    • the main manifest has no MainActivity;
    • RootActivity is the only MAIN/LAUNCHER activity in the main manifest;
    • the only debug launchers are DemoRootActivity and LocalRootActivity.
  • ExampleInstrumentedTest.harnessBannerIsShown asserts the banner is displayed. It compiles here; running it needs an emulator.
  • scripts/forbidden-capabilities.sh fails if MainActivity stops showing TEST_HARNESS_NOTICE.
  • CHANGELOG [Unreleased] line.

No product screen, API, or release behavior change. SOS-first RootActivity is untouched.

Local checks (CI cannot start: GitHub Actions billing block)

  • bash scripts/forbidden-capabilities.sh: passed.
  • python3 scripts/openapi-client-pin.py against suas main docs/openapi/v0.json: client routes match.
  • ./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleRelease :app:compileDebugAndroidTestKotlin: BUILD SUCCESSFUL. There are 45 unit tests and 0 failures, including the 5 new ones.
  • aapt2 dump xmltree on the release APK: the only activity is RootActivity. The debug APK has MainActivity, DemoRootActivity, LocalRootActivity and RootActivity.

Instrumented tests were not run (no emulator, no KVM on this box).

@scrimshawlife-ctrl
scrimshawlife-ctrl marked this pull request as ready for review October 7, 2026 23:48
@scrimshawlife-ctrl
scrimshawlife-ctrl merged commit d26a6a6 into main Oct 7, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T23:50:50.083906Z 304956a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@scrimshawlife-ctrl

Copy link
Copy Markdown
Owner Author

Squash merged at Danny's direction (2026-10-07 4:41 PM PT) while GitHub Actions jobs could not start because of the account billing block.

Local checks at 304956a passed:

  • scripts/forbidden-capabilities.sh
  • scripts/openapi-client-pin.py against suas main docs/openapi/v0.json
  • ./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleRelease :app:compileDebugAndroidTestKotlin (45 unit tests, 0 failures)
  • aapt2 release manifest check (only RootActivity)

Danny will verify with local runners. The instrumented harnessBannerIsShown test still needs an emulator.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 304956a36a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

factory.isNamespaceAware = true
val document = factory.newDocumentBuilder().parse(manifestFile)

val activityNodes = document.getElementsByTagName("activity")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include activity aliases in launcher checks

If either manifest adds a launcher through an <activity-alias>, these tests still pass because parseActivities collects only <activity> elements. Android permits MAIN/LAUNCHER filters on aliases, so this omission can allow an additional product or debug launcher despite the tests claiming to enforce the launcher sets; inspect both element types or validate the merged manifests instead.

AGENTS.md reference: AGENTS.md:L38-L38

Useful? React with 👍 / 👎.

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