Skip to content
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

Build unit tests based on main branch (user model) #1349

Merged
merged 6 commits into from
Dec 15, 2023

Conversation

nan-li
Copy link
Contributor

@nan-li nan-li commented Dec 10, 2023

Description

One Line Summary

Get unit tests to build after the changes we made to the SDK going from player model to user model.

Details

Motivation

Unit tests were failing because so much of the SDK has changed, and we did not update unit tests yet.

Scope

Much of the changes in this PR is commenting out failing test files. I opted to comment out instead of deleting files or test cases.

Note that the non-failing tests may still need to be refactored since passing doesn't necessarily mean they worked.

Testing

Unit testing

Majority of tests have been removed by commenting out.

Manual testing

Unit tests now build and run.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

- Had some errors
- that changed after API changed
* Commenting out any file that was failing in some way
* Opt to comment out instead of deleting files.
* Motivation: encountered error with "Include of non-modular header inside framework module OneSignalCore" and crashing on start with "Library not loaded OneSignalOSCore"...
* Update the following build configurations that were different between Debug & Release and Test

- Skip Install - Test - changed from NO to YES
- Strip Debug Symbols During Copy - Test - changed from YES to NO
- Targeted Device Families - Test - iPhone to iPhone and iPad
- Compatibility Version - Test - set to 1
- Current Library Version - Test - set to 1
- Dynamic Library Install Name Base - Test - changed to rpath
- Runpath Search Paths - Test - updated to match
- Use Compiler to Extract Swift Strings - Test - changed to YES
- Defines Module - Test - changed to YES
- Generate Info.plist File - Test - changed to YES to match Release and Debug
- enable modules - Test - set to YES
- `OneSignalLiveActivityController.m` added to UnitTests target membership
- Adds missing `OneSignalLocation.framework` and `OneSignalInAppMessages.framework` and `OneSignalNotifications.framework` to UnitTests target "Frameworks and Libraries". Split out after modularization..
- UNUserNotificationCenterOverrider was causing a crash
@nan-li nan-li requested review from jkasten2 and emawby and removed request for jkasten2 December 10, 2023 23:35
Base automatically changed from fix_swift_lint to main December 15, 2023 20:24
@nan-li nan-li merged commit afb165c into main Dec 15, 2023
2 checks passed
@nan-li nan-li deleted the 5.0.0/unit_tests_merge_now_builds branch December 15, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants