-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow running WordPressTests standalone via the Keystone scheme #24537
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: trunk
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 28006 | |
| Version | PR #24537 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | e76609c | |
| Installation URL | 1c4kd1c0obkvg |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 28006 | |
| Version | PR #24537 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | e76609c | |
| Installation URL | 5hr3c9isg71rg |
5cc5a08 to
02f660f
Compare
e1eb12f to
a991701
Compare
92de5e1 to
56c4ada
Compare
The only iOS version available out of the box with the 16.3 stack.
b21014f to
47ea74f
Compare
imports required to compile Keystone for testingJust trying to understand why Keystone fails to build for testing. Using forward declarations keeps the headers and the compilation leaner.
Clearly the issues documented in some of the usages were temporary due to the transition.
47ea74f to
e76609c
Compare
|
|
Version |
|
@claude review |
|
Claude finished @wzieba's task —— View job Code Review for PR #24537Tasks
SummaryThis PR successfully addresses the issue of building Keystone for testing by adding necessary imports and cleaning up the codebase. The changes are well-structured and follow good practices for modular Objective-C development. Key Changes
Detailed Review✅ Strengths1. Build Configuration (
2. Import Strategy
3. Code Organization
4. Preprocessor Cleanup 5. Swift Files 🔍 Observations & Questions1. Objective-C Header Pattern
This is cleaner than either 2. Scheme Configuration
3. Test Coverage
🔒 SecurityNo security concerns identified. The changes are purely build configuration and import statements. ⚡ PerformancePositive impacts:
🧪 TestingThe PR enables Keystone tests in CI, which is the main goal. However:
📝 DocumentationMinor suggestions:
🎯 Code QualityOverall code quality is excellent. The changes are:
Minor Suggestions
Recommendation✅ Approve with minor suggestions This is solid work that fixes a real build issue and improves code organization. The iterative approach visible in the commits shows good problem-solving methodology. The main deliverable (Keystone builds and tests run) appears to be achieved. The inline comments I've left are mostly positive observations and minor suggestions - none are blocking issues. Great job on the cleanup! The removal of 270 lines of Note: I've left several inline comments on specific files with detailed feedback. |
| -destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \ | ||
| test \ | ||
| | xcbeautify | ||
| command: .buildkite/commands/run-unit-tests-for-scheme.sh Keystone |
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.
Great addition! This properly runs Keystone tests in CI using the new reusable command. However, I noticed that the scheme configuration issue mentioned in the PR description (scheme not configured to run tests) wasn't included in the changed files list. Was the Keystone.xcscheme file updated in this PR? If so, it would be helpful to see that change to verify the test configuration is correct.
| #!/bin/bash -euo pipefail | ||
|
|
||
| SCHEME="${1:?Usage $0 SCHEME}" | ||
| DEVICE="iPhone 16" |
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.
Minor suggestion: Consider making DEVICE and OS_VERSION configurable via optional parameters with these as defaults. This would make the script more flexible for testing different device/OS combinations without modification.
DEVICE="${2:-iPhone 16}"
OS_VERSION="${3:-18.4}"| @@ -1,11 +1,11 @@ | |||
| #import <Foundation/Foundation.h> | |||
| #import <CoreData/CoreData.h> | |||
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.
Question: I notice the @import WordPressData has been removed from this header. According to commit acb8b33, there was initially a concern that "for some reason, and only in some files, the modular import does not work" and all files were changed to use angle brackets. Then commit 9273a3f restored modular imports, noting the issues were "temporary due to the transition."
However, in the current state, this header file has no WordPressData import at all - neither @import nor #import. This works because you've added forward declarations (@class, @protocol) which is the proper Objective-C pattern for headers.
This is actually the cleanest approach - using forward declarations in headers and only importing in .m files keeps compilation times down and reduces dependencies. Nice work! 👍
Just want to confirm this was intentional and not an oversight.
| @@ -0,0 +1,22 @@ | |||
| import WordPressKit | |||
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.
Good refactoring! Moving this extension from WordPress/Classes to Sources/WordPressData/Swift makes sense since it extends RemotePostUpdateParameters which is part of WordPressData. This improves modularity and keeps related code together.
The file properly imports WordPressKit which provides the types needed by this extension.
|
☝️ just testing Claude Reviews |
|
Hey, this is pretty cool! I'd probably try a different, more "standard" PR that has no infrastructure changes. I can volunteer any of my PRs, for example this one.
Let's cut the "Great addition!", "Good refactoring!" and other congratulatory stuff. Similarly, in the "Observations" sections, none seem to add value.
It can't approve or disapprove – just make suggestions.
I'd keep the minor suggestions out of it. Both of these don't make much sense in our context: the PRs are squashed and there are no "developer guides". It needs to focus on what it considers "critical" that you have to fix before merging – any potentials regressions, defects, serious issues for code maintainability – and it keep it as concise as possible. |
|
Thanks for the comments on the solution @kean ! Please, feel free to edit the instructions yourself in
|
Gotcha. Thanks! |





Description
This PR adds a number of import statement that seem necessary to build Keystone for testing. Without them, on my machine, the build fails.
I landed on this PR via two different streams of work:
WordPressUnitTests.xctestplantoKeystoneTests.xctestplanfor clarity (not yet open as a PR)With both, I wanted to build Keystone for testing (
Shift Cmd U), and got compilation failures. Many iterations later, all the required imports are in place.The reason we never noticed despite having a CI step to run Keystone tests is that the scheme was not (never was? 🤔 ) configured to run tests
This has now been rectified.
Testing instructions