forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 121
Add ai agent skill for iOS instrumented tests #2847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ASalavei
wants to merge
2
commits into
jb-main
Choose a base branch
from
andrei.salavei/ios-instrumented-test-skill
base: jb-main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../ai-skills |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../ai-skills |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../ai-skills |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| name: ios-instrumented-tests | ||
| description: This skill should be used when the user asks about "running iOS tests", "iOS instrumented tests", "how to run ios tests", "launch specific ios test" and these tests are located in the "compose/ui/ui/src/uikitInstrumentedTest" directory. | ||
| version: 1.0.0 | ||
| --- | ||
|
|
||
| iOS Instrumented tests are designed to run XCTests written on Kotlin using the iOS Simulator as an environment. | ||
|
|
||
| # iOS Instrumented Tests — Compose Multiplatform Core | ||
|
|
||
| Perform steps exactly in the following order: | ||
|
|
||
| ## Configure which tests should be started | ||
| In the file compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/Configuration.kt write all tests that must be launched. Add corresponding imports in the header. Save the file. If it's needed to run all instrumented, pass nothing to the setupXCTestSuite. | ||
mazunin-v-jb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Follow the examples in commented code in the file. Note: configuration can launch either entire test classes or multiple test cases from a single test class only. | ||
|
|
||
| ## Running All iOS Tests | ||
|
|
||
| 1. Get a list of all devices and select the most appropriate one. Prefer the latest iPhone with the latest iOS if nothing else said. Select and remember corresponding simulator id for the next step. | ||
| ``` | ||
| xcrun xctrace list devices | ||
| ``` | ||
|
|
||
| 2. Navigate to the launcher repository root: | ||
|
|
||
| ```bash | ||
| cd compose/ui/ui/src/uikitInstrumentedTest/launcher | ||
| ``` | ||
|
|
||
| 3. Build and run tests | ||
| ``` | ||
| xcodebuild test -scheme Launcher -project Launcher.xcodeproj -destination 'platform=iOS Simulator,id=<Simulator ID>' | ||
| ``` | ||
|
|
||
| # Key Test Source Locations | ||
| (from the repository root) | ||
| `compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/Configuration.kt` - location of the configuration file which determines which tests to run. | ||
| `compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/test` - Test environment and utilities to configure tests | ||
| `testutils/testutils-xctest/` - Contains a Kotlin wrapper that allows converting Kotlin tests to XCTests as well as an Objective-C project that provides API for low-level touches and other input gesture simulation. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates and extends the "Run iOS instrumented tests" in
MULTIPLATFORM.md, and seems useful for humans too?Can we just move all this there, and point agents to the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean, to use
MULTIPLATFORM.mdinstead of skills - not sure it's a good idea. At least it goes against the documentation. Skills have very specific format and dedication. If you want the agent to do tasks efficiently, you should follow this guidelines.Obviously, we can tell the LLM to read
MULTIPLATFORM.mdbefore doing any job, but it won't be the same.I would say, vice versa it does not work either because skills will have things like
This skill should be used when the user asks about "running iOS tests", "iOS instrumented tests", "how to run ios tests", "launch specific ios test" and these tests are located in the "compose/ui/ui/src/uikitInstrumentedTest" directory.which does not look good for human-readable manualThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I am worried about:
MULTIPLATFORM.mdtestutils-xctestuikitInstrumentedTestenvironment is located (compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/test)Maybe we can solve it this way:
Though, if you think it could degrade performance of the agent, we can accept the new duty of keeping this up-to-date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have doubts, another opinion, or it is more difficult to implement, I am fine just with the current skill