You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements the suggestion from "RFC – Dedicated test suite for slow and performance tests".
Adds a new target to run the performance tests. I used WordPress as a target app and try to keep the target configuration as simple as possible. I ended up duplicating a bit of code, which I think is acceptable in this case.
I suggest not running the performance tests on the CI, as there is no good way to compare the performance across different executions on difference machines. The performance tests are mainly useful when working on optimizations to compare the before and the after.
To test:
Run pod install
Verify that the new WordPressPerformanceTests target runs
Measuring the impact:
// Before
Test Suite 'All tests' failed at 2023-12-25 14:55:09.438.
Executed 1922 tests, with 1 test skipped and 21 failures (0 unexpected) in 77.174 (78.079) seconds
// After
Test Suite 'All tests' failed at 2023-12-25 13:28:16.761.
Executed 1918 tests, with 1 test skipped and 21 failures (0 unexpected) in 54.920 (55.530) seconds
That's a 22.5 sec improvement and with the removal of the outdated version, the unit test execution time will be reduced by nearly half.
Regression Notes
Potential unintended areas of impact: n/a
What I did to test those areas of impact (or what existing automated tests I relied on): n/a
What automated tests I added (or what prevented me from doing so): n/a
PR submission checklist:
I have completed the Regression Notes.
I have considered adding unit tests for my changes.
I have considered adding accessibility improvements for my changes.
I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
UI Changes testing checklist:
Portrait and landscape orientations.
Light and dark modes.
Fonts: Larger, smaller and bold text.
High contrast.
VoiceOver.
Languages with large words or with letters/accents not frequently used in English.
Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
I offer sub-decisecond as a target. That is, each individual test() in an XCTestCase subclass should run in less than 0.1 of a second.
I think that performance tests are not unit tests and hence need to be in a separate target, similar to the UI-driven tests.
In this PR, I think I ended up extracting a couple of unit tests as well because of the slow execution time, e.g. testFlatList. If it's feasible to keep them in the unit test target, it would be great. Btw, is there a way to reduce the number of pages used for these tests, assuming they aren't testing performance?
I think that performance tests are not unit tests and hence need to be in a separate target, similar to the UI-driven tests.
Sounds good to me!
Btw, is there a way to reduce the number of pages used for these tests, assuming they aren't testing performance?
It's totally fine to reduce the number of pages. I used a large number just so that it's easier to see the time difference between the old and new implementation.
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
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.
Implements the suggestion from "RFC – Dedicated test suite for slow and performance tests".
Adds a new target to run the performance tests. I used WordPress as a target app and try to keep the target configuration as simple as possible. I ended up duplicating a bit of code, which I think is acceptable in this case.
I suggest not running the performance tests on the CI, as there is no good way to compare the performance across different executions on difference machines. The performance tests are mainly useful when working on optimizations to compare the before and the after.
To test:
pod installMeasuring the impact:
That's a 22.5 sec improvement and with the removal of the outdated version, the unit test execution time will be reduced by nearly half.
Regression Notes
PR submission checklist:
RELEASE-NOTES.txtif necessary.UI Changes testing checklist: