-
Notifications
You must be signed in to change notification settings - Fork 267
chore(tests): Update flaky badge clearing tests #1616
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
Open
nan-li
wants to merge
10
commits into
tests/add_iam_tests
Choose a base branch
from
chore/fix_flaky_badge_tests
base: tests/add_iam_tests
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+791
−43
Conversation
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 all frameworks to check code coverage for. * Reminder there are 2 test plans that can be run: - UnitTestApp_TestPlan_Reduced (default plan in CI) - UnitTestApp_TestPlan_Full (default plan in Xcode)
Add Swift `IAMIntegrationTests` test file and check for accessibility of `OSMessagingController` from the test file
* no longer used, dead code
* Aren't called by anything so no need to be on the interface, these are called by the class itself.
* Without a description, the object will return something like `<OSRequestGetInAppMessages: 0x600001798bc0>`. By adding a predictable description, we can operate on the object.
* Re-usable test helpers and mock functionality * Include own swiftlint file * ❗️ After `OneSignalInAppMessagesMocks` was created, I had to then manually "convert to group" or else the CI had build errors about the following: xcodebuild: error: Unable to read project 'OneSignal.xcodeproj' Reason: The project ‘OneSignal’ is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts. Exception: didn't find classname for 'isa' key
…alInAppMessages * This extension on `UIApplication` is only used in the `OneSignalInAppMessages` framework, so there is no need to keep it in the umbrella `OneSignalFramework` framework, which causes errors if only `OneSignalInAppMessages` is tested (without also importing OneSignalFramework).
* Has helper methods for repeating functionality
* Attempt to migrate `testDisablingIAMs_stillCreatesMessageQueue_butPreventsMessageDisplay` to new tests, but behavior has changed. It becomes `testPausingIAMs_doesNotCreateMessageQueue` * Migrate `testPreviewIAMIsDisplayedOnPause`
4348c8c to
5b5ce67
Compare
These two tests have been consistently flaky, the usage of `UIApplication.shared.applicationIconBadgeNumber` is async and deprecated, and we have removed this usage from the SDK itself. Now update the tests to match current behavior.
5b5ce67 to
c286ea0
Compare
jkasten2
approved these changes
Dec 1, 2025
19374af to
2267465
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
One Line Summary
Update flaky badge clearing tests that have been consistently failing in CI.
Details
These two badge clearing tests have been consistently flaky, as the usage of
UIApplication.shared.applicationIconBadgeNumberappears to be async so values are not accurate immediately. Additionally, this API and deprecated, and we have removed this usage from the SDK itself in #1568. These changes will also update the tests to match current behavior.Motivation
Fix CI
Scope
Tests only
Testing
Unit testing
Updated 2 badge clearing tests
Manual testing
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is