-
Notifications
You must be signed in to change notification settings - Fork 18
[#688] Add selective testing tool to the project #692
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,9 @@ jobs: | |
| restore-keys: | | ||
| ${{ runner.os }}-gems- | ||
|
|
||
| - name: Setup Mint | ||
| uses: irgaly/setup-mint@8566ee44b3a79d20642d1924db21c8ab0402859f # irgaly/setup-mint@v1 | ||
|
|
||
|
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use |
||
| - name: Setup CI environment | ||
| uses: ./.github/actions/setup-ci-environment | ||
| with: | ||
|
|
@@ -41,6 +44,13 @@ jobs: | |
| - name: Run Arkana | ||
| run: bundle exec arkana | ||
|
|
||
| # using mikeger/XcodeSelectiveTesting@0.14.5 | ||
| - name: Modify test plan | ||
| run: | | ||
| mint run mikeger/XcodeSelectiveTesting@1c0927e5553a9ddb6b3634d6d13497651a0ef476 {PROJECT_NAME}.xcodeproj \ | ||
| --test-plan {PROJECT_NAME}.xctestplan \ | ||
| --base-branch origin/${{ github.base_ref }} | ||
|
|
||
| - name: Build and Test | ||
| run: bundle exec fastlane buildAndTest | ||
| env: | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -168,6 +168,10 @@ class Fastfile: LaneFile { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| func buildAndTestLane() { | ||||||||||||||||||||||||||||||||||
| desc("Build and Test project") | ||||||||||||||||||||||||||||||||||
| guard testTargetCount() > 0 else { | ||||||||||||||||||||||||||||||||||
| echo(message: "🚨 Nothing to test") | ||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Test.buildAndTest( | ||||||||||||||||||||||||||||||||||
| environment: .staging, | ||||||||||||||||||||||||||||||||||
| devices: Constant.devices | ||||||||||||||||||||||||||||||||||
|
|
@@ -176,6 +180,10 @@ class Fastfile: LaneFile { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| func buildAndTestDevLane() { | ||||||||||||||||||||||||||||||||||
| desc("Build and Test dev project") | ||||||||||||||||||||||||||||||||||
| guard testTargetCount() > 0 else { | ||||||||||||||||||||||||||||||||||
| echo(message: "🚨 Nothing to test") | ||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Test.buildAndTest( | ||||||||||||||||||||||||||||||||||
| environment: .dev, | ||||||||||||||||||||||||||||||||||
| devices: Constant.devices | ||||||||||||||||||||||||||||||||||
|
|
@@ -268,4 +276,13 @@ class Fastfile: LaneFile { | |||||||||||||||||||||||||||||||||
| buildNumber: .userDefined("\(theLatestBuildNumber)") | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| private func testTargetCount(in testPlanPath: String = "\(Constant.projectName).xctestplan") -> Int { | ||||||||||||||||||||||||||||||||||
| guard let data = FileManager.default.contents(atPath: testPlanPath), | ||||||||||||||||||||||||||||||||||
| let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any], | ||||||||||||||||||||||||||||||||||
| let testTargets = json?["testTargets"] as? [Any] else { | ||||||||||||||||||||||||||||||||||
| return 0 | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| return testTargets.count | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+280
to
+287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary optional chaining on After the 🛠️ Proposed fix- private func testTargetCount(in testPlanPath: String = "\(Constant.projectName).xctestplan") -> Int {
- guard let data = FileManager.default.contents(atPath: testPlanPath),
- let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
- let testTargets = json?["testTargets"] as? [Any] else {
- return 0
- }
- return testTargets.count
- }
+ private func testTargetCount(in testPlanPath: String = "\(Constant.projectName).xctestplan") -> Int {
+ guard let data = FileManager.default.contents(atPath: testPlanPath),
+ let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
+ let testTargets = json["testTargets"] as? [Any] else {
+ return 0
+ }
+ return testTargets.count
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "configurations" : [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "id" : "C56A3802-C716-4C08-8B7A-53EFE53D4FE0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name" : "Configuration 1", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "options" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "defaultOptions" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testTargets" : [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "target" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "containerPath" : "container:TestTemplate.xcodeproj", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test plan is still hardcoded to TestTemplate...please update it
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "identifier" : "PLACEHOLDER", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name" : "DomainTests" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "target" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "containerPath" : "container:TestTemplate.xcodeproj", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "identifier" : "PLACEHOLDER", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name" : "TestTemplateTests" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "target" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "containerPath" : "container:TestTemplate.xcodeproj", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "identifier" : "PLACEHOLDER", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name" : "DataTests" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "target" : { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "containerPath" : "container:TestTemplate.xcodeproj", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "identifier" : "PLACEHOLDER", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name" : "ModelTests" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded
As a result, Xcode will refuse to load the test plan and 🐛 Proposed fix {
"target" : {
- "containerPath" : "container:TestTemplate.xcodeproj",
+ "containerPath" : "container:{PROJECT_NAME}.xcodeproj",
"identifier" : "PLACEHOLDER",
"name" : "DomainTests"
}
},
{
"target" : {
- "containerPath" : "container:TestTemplate.xcodeproj",
+ "containerPath" : "container:{PROJECT_NAME}.xcodeproj",
"identifier" : "PLACEHOLDER",
- "name" : "TestTemplateTests"
+ "name" : "{PROJECT_NAME}Tests"
}
},
{
"target" : {
- "containerPath" : "container:TestTemplate.xcodeproj",
+ "containerPath" : "container:{PROJECT_NAME}.xcodeproj",
"identifier" : "PLACEHOLDER",
"name" : "DataTests"
}
},
{
"target" : {
- "containerPath" : "container:TestTemplate.xcodeproj",
+ "containerPath" : "container:{PROJECT_NAME}.xcodeproj",
"identifier" : "PLACEHOLDER",
"name" : "ModelTests"
}
}As per coding guidelines: "Do not replace template placeholders (e.g., {PROJECT_NAME}, {BUNDLE_ID_STAGING}) with concrete values inside the template; preserve them for generation-time substitution". 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "version" : 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: nimblehq/ios-templates
Length of output: 1537
Add
mintto.mise.tomlor include an explicitSetup Mintstep.The self-hosted workflow uses
mint runat line 46, but unlike the hosted workflow (which addsirgaly/setup-mint@v1), this file has no explicit Mint setup. TheInstall tools with misestep relies on.mise.toml, butmintis not declared there. This will cause the workflow to fail withcommand not foundwhen attempting to run the Mint command.Either add
mintto the[tools]section in.mise.toml, or add aSetup Mintstep symmetric to the hosted workflow.🤖 Prompt for AI Agents