Feature Request: An `xcodeproj_test` rule to test configured `xcodeproj` running the installer and then executing select `xcodebuild` actions against the generated Xcode project
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ios, swift
- Domain
- build-system, mobile-dev, testing-qa
Research direction
Start with the xcodeproj_test usage described in the issue and the examples/ios_app configuration. Trace how the xcodeproj target is installed, then determine how the default runner should invoke xcodebuild for the selected scheme and build_actions. Done means the generated project and scheme can be exercised, with support for a custom runner as described.
Written by the indexing model from the issue text.
Description
Goals
- Provide assurances to
rules_xcodeprojcontributors that changes to the underlying rules work. - Allow clients of
rules_xcodeprojto test the schemes for configured projects.- Execute a build command for a scheme.
- Execute a test command for a scheme.
Design/Usage
- Provide
xcodeproj_testthat handles the test setup and Xcode project installation. - Provide a default test runner that executes
xcodebuildcommands against the Xcode project. - Allow clients to provide their own test runner.
Details
The idea is that we want to exercise the generated project/scheme. The following example is based upon examples/ios_app.
XCODEPROJ_TARGETS = [
"//Example",
"//ExampleTests",
"//ExampleObjcTests",
"//ExampleUITests",
]
XCODEPROJ_SCHEMES = [
xcode_schemes.scheme(
name = "ios_app",
launch_action = xcode_schemes.launch_action("//Example"),
test_action = xcode_schemes.test_action(
"//ExampleTests",
"//ExampleObjcTests",
"//ExampleUITests",
),
),
]
xcodeproj(
name = "xcodeproj",
project_name = "iOS App",
tags = ["manual"],
top_level_targets = XCODEPROJ_TARGETS,
schemes = XCODEPROJ_SCHEMES,
)
We want to be sure that the generated project and scheme work properly.
# This test will run the installer for `:xcodeproj`, then run the following:
# xcodebuild -project iOS\ App.xcodeproj -scheme ios_app \
# -sdk iphonesimulator \
# -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.3' \
# test archive
# If the the command succeeds, the test passes. If the command does not, the test fails.
xcodeproj_test(
name = "ios_app_scheme_test",
xcodeproj = ":xcodeproj",
scheme = "ios_app",
# The `xcodebuild -help` lists these as `buildaction`. The interesting ones are `build`,
# `archive`, and `test`.
build_actions = ["test", "archive"],
)
Alternative Design
You may want to separate the test from the runner. The test would take a reference to an xcodeproj target. It would prepare the test and run the installer. The runner would execute the xcodebuild command. The benefit would be that other runners could be used instead of an xcodebuild runner.
- Dominant language
- Swift
- Stars
- 626
- Forks
- 124
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MobileNativeFoundation/rules_xcodeproj
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 25/100
MobileNativeFoundation/rules_xcodeproj#3282 · 1 reaction ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 35/100
MobileNativeFoundation/rules_xcodeproj#3281 · 1 comment · 1 reaction ·
All issues in MobileNativeFoundation/rules_xcodeproj
Similar issues
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
skiptools/skip-fuse-ui#147 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OneBusAway/onebusaway-ios#1438 · 1 reaction ·