Add ability to run only the unit tests#237
Conversation
WalkthroughThis pull request introduces new and updated Xcode scheme files to manage the build, test, launch, profile, analyze, and archive actions for the project. The configuration now explicitly references test plans instead of auto-creating them. New test plan files have been added for both all tests and unit tests, and the workspace configuration has been updated to include the unit tests. Additionally, the integration tests in the code have been tagged for better categorization, and the documentation is enhanced with instructions on running only unit tests. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant IDE as Xcode IDE
participant Scheme as Scheme Files
participant TP as Test Plan Loader
participant TR as Test Runner
Dev->>IDE: Initiate test run
IDE->>Scheme: Load scheme configurations (AblyChat, BuildTool)
Scheme->>TP: Retrieve associated test plans (AllTests, UnitTests)
TP-->>IDE: Return test plan details
Dev->>IDE: Select UnitTests plan
IDE->>TR: Execute unit tests (skipping integration tests)
TR-->>IDE: Return test results
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
CONTRIBUTING.md (1)
22-26: Fix typo in documentationThere's a minor typo in the description - the word "the" is repeated.
-There is a test plan called `UnitTests` which will run only the the unit tests. These tests are very quick to execute, so it's a useful option to have for quick feedback when developing. +There is a test plan called `UnitTests` which will run only the unit tests. These tests are very quick to execute, so it's a useful option to have for quick feedback when developing.🧰 Tools
🪛 LanguageTool
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... calledUnitTestswhich will run only the the unit tests. These tests are very quick ...(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...(EN_WEAK_ADJECTIVE)
TestPlans/AllTests.xctestplan (1)
1-24: Consider adding the same default options as in UnitTests planThe AllTests plan looks good but for consistency with the UnitTests plan, consider adding the same default option for enabling test timeouts.
"defaultOptions" : { - + "testTimeoutsEnabled" : true },This would ensure consistent timeout behavior across both test plans.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
images/unit-tests-test-plan.pngis excluded by!**/*.png
📒 Files selected for processing (8)
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme(1 hunks)AblyChat.xcworkspace/contents.xcworkspacedata(1 hunks)CONTRIBUTING.md(1 hunks)TestPlans/AllTests.xctestplan(1 hunks)TestPlans/UnitTests.xctestplan(1 hunks)Tests/AblyChatTests/IntegrationTests.swift(1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... called UnitTests which will run only the the unit tests. These tests are very quick ...
(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...
(EN_WEAK_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: Example app, tvOS (Xcode 16)
- GitHub Check: Example app, iOS (Xcode 16)
- GitHub Check: Xcode, tvOS (Xcode 16)
- GitHub Check: Example app, macOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, tvOS (Xcode 16) - GitHub Check: Xcode, iOS (Xcode 16)
- GitHub Check: Xcode, macOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, iOS (Xcode 16) - GitHub Check: Xcode,
releaseconfiguration, macOS (Xcode 16) - GitHub Check: SPM,
releaseconfiguration (Xcode 16) - GitHub Check: SPM (Xcode 16)
- GitHub Check: check-documentation
🔇 Additional comments (9)
AblyChat.xcworkspace/contents.xcworkspacedata (1)
4-6: LGTM: Test plan reference correctly added to workspaceThe FileRef element for the UnitTests.xctestplan is properly added to the workspace, making the unit tests plan accessible within the development environment.
TestPlans/UnitTests.xctestplan (1)
1-29: Well-structured test plan for unit testsThe test plan is properly configured to:
- Skip integration tests by filtering out the ".integration" tag
- Enable test timeouts by default
- Target the AblyChatTests test bundle
This configuration will effectively isolate and run only unit tests, which aligns perfectly with the PR objective.
CONTRIBUTING.md (1)
24-26: Good use of screenshot for visual guidanceIncluding a screenshot showing how to activate the UnitTests test plan is very helpful for contributors who may be unfamiliar with Xcode test plans.
🧰 Tools
🪛 LanguageTool
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... calledUnitTestswhich will run only the the unit tests. These tests are very quick ...(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...(EN_WEAK_ADJECTIVE)
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme (1)
30-39: Well-structured test plan configuration.The change from auto-creating test plans to explicitly referencing predefined test plans is well-implemented. This configuration now supports both the complete test suite (AllTests) and the unit tests only option (UnitTests), which directly supports the PR objective of allowing developers to run only unit tests.
Tests/AblyChatTests/IntegrationTests.swift (2)
5-8: Good implementation of test tagging.The extension to
Tagwith theintegrationstatic property is well-documented and provides a clear way to categorize tests. This is essential for the test filtering mechanism to work properly.
13-13: Appropriate tagging of the integration test suite.The update to the
@Suiteannotation properly tags this entire struct as integration tests, which will allow the test plans to selectively include or exclude these tests based on the tag..swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme (1)
1-78: Properly configured scheme for the BuildTool target.This new scheme file correctly configures all the necessary build, test, launch, profile, analyze, and archive actions for the BuildTool target. It follows standard Xcode scheme configuration practices.
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme (2)
45-53: Consistent test plan configuration across schemes.The test plans configuration here matches that in the AblyChat.xcscheme file, ensuring consistent behavior between the single-target and package-level schemes. This is good practice for maintaining a predictable developer experience.
9-38: Comprehensive build configuration for package targets.The build action properly includes both the AblyChat and BuildTool targets, ensuring that all necessary components are built when working with the package-level scheme.
d38179e to
33af042
Compare
33af042 to
b3d6458
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CONTRIBUTING.md (1)
24-24: Fix Minor Typographical and Stylistic IssuesThere is a duplicated word ("the the") that should be corrected. Additionally, consider simplifying the phrasing to avoid over-emphasis with "very quick."
Below is a suggested revision:-There is a test plan called `UnitTests` which will run only the the unit tests. These tests are very quick to execute, so it's a useful option to have for quick feedback when developing. +There is a test plan called `UnitTests` which will run only the unit tests. These tests execute quickly, providing useful feedback during development.🧰 Tools
🪛 LanguageTool
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... calledUnitTestswhich will run only the the unit tests. These tests are very quick ...(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...(EN_WEAK_ADJECTIVE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
⛔ Files ignored due to path filters (1)
images/unit-tests-test-plan-screenshot.pngis excluded by!**/*.png
📒 Files selected for processing (8)
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme(1 hunks)AblyChat.xcworkspace/contents.xcworkspacedata(1 hunks)CONTRIBUTING.md(1 hunks)TestPlans/AllTests.xctestplan(1 hunks)TestPlans/UnitTests.xctestplan(1 hunks)Tests/AblyChatTests/IntegrationTests.swift(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
- AblyChat.xcworkspace/contents.xcworkspacedata
- .swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme
- Tests/AblyChatTests/IntegrationTests.swift
- TestPlans/AllTests.xctestplan
- .swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme
- .swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme
- TestPlans/UnitTests.xctestplan
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... called UnitTests which will run only the the unit tests. These tests are very quick ...
(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...
(EN_WEAK_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (11)
- GitHub Check: Example app, tvOS (Xcode 16)
- GitHub Check: Example app, iOS (Xcode 16)
- GitHub Check: Example app, macOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, tvOS (Xcode 16) - GitHub Check: Xcode, tvOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, iOS (Xcode 16) - GitHub Check: SPM (Xcode 16)
- GitHub Check: Xcode, iOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, macOS (Xcode 16) - GitHub Check: Xcode, macOS (Xcode 16)
- GitHub Check: SPM,
releaseconfiguration (Xcode 16)
🔇 Additional comments (1)
CONTRIBUTING.md (1)
22-27: New Unit Tests Section Added SuccessfullyThe new section clearly details the process for running only the unit tests and includes an illustrative screenshot, which enhances usability. This aligns well with the PR objective of speeding up feedback during development.
🧰 Tools
🪛 LanguageTool
[duplication] ~24-~24: Possible typo: you repeated a word.
Context: ... calledUnitTestswhich will run only the the unit tests. These tests are very quick ...(ENGLISH_WORD_REPEAT_RULE)
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...nly the the unit tests. These tests are very quick to execute, so it's a useful option to ...(EN_WEAK_ADJECTIVE)
b3d6458 to
4e3af17
Compare
This excludes the long-running integration test. Useful for quick feedback when developing, and also for quickly checking that we haven't accidentally introduced a long-running unit test.
4e3af17 to
1cb77c5
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CONTRIBUTING.md (1)
22-29: Clarify and polish the new "Running only the unit tests" section.
The newly added section effectively guides contributors on how to activate theUnitTeststest plan with a helpful screenshot. A small improvement would be to remove the intensifier "very" in the sentence on line 24 for more concise language. For example, you might consider changing “These tests are very quick to execute” to “These tests execute quickly.”🧰 Tools
🪛 LanguageTool
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...un only the unit tests. These tests are very quick to execute, so it's a useful option to ...(EN_WEAK_ADJECTIVE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
⛔ Files ignored due to path filters (1)
images/unit-tests-test-plan-screenshot.pngis excluded by!**/*.png
📒 Files selected for processing (8)
.swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme(1 hunks).swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme(1 hunks)AblyChat.xcworkspace/contents.xcworkspacedata(1 hunks)CONTRIBUTING.md(1 hunks)TestPlans/AllTests.xctestplan(1 hunks)TestPlans/UnitTests.xctestplan(1 hunks)Tests/AblyChatTests/IntegrationTests.swift(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
- TestPlans/UnitTests.xctestplan
- AblyChat.xcworkspace/contents.xcworkspacedata
- .swiftpm/xcode/xcshareddata/xcschemes/AblyChat.xcscheme
- .swiftpm/xcode/xcshareddata/xcschemes/BuildTool.xcscheme
- Tests/AblyChatTests/IntegrationTests.swift
- TestPlans/AllTests.xctestplan
- .swiftpm/xcode/xcshareddata/xcschemes/AblyChat-Package.xcscheme
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[style] ~24-~24: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...un only the unit tests. These tests are very quick to execute, so it's a useful option to ...
(EN_WEAK_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (11)
- GitHub Check: Example app, tvOS (Xcode 16)
- GitHub Check: Xcode, tvOS (Xcode 16)
- GitHub Check: Example app, iOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, tvOS (Xcode 16) - GitHub Check: Xcode, iOS (Xcode 16)
- GitHub Check: Example app, macOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, iOS (Xcode 16) - GitHub Check: Xcode, macOS (Xcode 16)
- GitHub Check: Xcode,
releaseconfiguration, macOS (Xcode 16) - GitHub Check: SPM (Xcode 16)
- GitHub Check: SPM,
releaseconfiguration (Xcode 16)
This excludes the long-running integration test. Useful for quick feedback when developing, and also for quickly checking that we haven't accidentally introduced a long-running unit test.
Summary by CodeRabbit
New Features
Tests
Documentation