Repository navigation
Spike: cover App Intents with AppIntentsTesting on the macOS 27 CI leg #189
Description
Why
#167 (PR #188) added Spotlight and Shortcuts support: ContainerEntity and MachineEntity, plus Start, Stop and Open intents. Its tests cover the logic behind the intents (ComputeIntentActions, entity lookup, the index diff), but not the path through the system. That path broke during local testing: with several copies of app.berthly.Berthly registered, linkd never read the build's intents metadata, and Spotlight and Shortcuts silently showed nothing. Unit tests could not catch that.
Calling an intent's perform() directly in a unit test crashes the test host, because @Parameter and @Dependency assert outside the intent runtime. So the intent wrappers themselves are untested.
What
Spike AppIntentsTesting (new in Xcode 27), which drives an app's intents and entities through the system by bundle ID and type identifier, without UI automation.
- Find out how a test resolves an entity reference (for example
AppEntityDefinition.makeReference(identifier:)) and runs an intent with it. - Write one test: run Start Container against a stopped mock container and check it ends up running.
- Decide where it lives. It probably needs to be a UI-test-style target, since it talks to the app out of process.
Constraints
- macOS 27 and Xcode 27 only. Every type is
@available(macOS 27.0, *)and the framework does not ship with Xcode 26, so the macOS 26 gate cannot compile it. Guard the file with#if canImport(AppIntentsTesting)and run it only on the advisory macOS 27 leg. - Mock data only. It must use mock mode (
UITEST_USE_MOCK_SERVICE), never a real daemon, and must not write to the runner's Spotlight index.SpotlightIndexer.shouldRunalready skips indexing in mock mode. - Registration on CI is unproven. Check whether the
xcode-27runner registers the built app's intents reliably, using/usr/bin/logand thelinkdlineChecking app.berthly.Berthly at .../extract.actionsdata. If it is flaky, record that and stop, rather than adding another advisory flake like Flaky UI test: LargeInventoryTests fails clicking the last scrolled row #182.
Out of scope
Scripting the Spotlight or Shortcuts UI with XCUITest. It would be slow and brittle, and it depends on system registration state.
Done when
Either one passing AppIntentsTesting test runs on the macOS 27 leg, or a short write-up explains why it isn't viable on CI yet.
Activity