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

Fix unit tests and add CI jobs #467

Merged
merged 11 commits into from
May 6, 2024
Merged

Fix unit tests and add CI jobs #467

merged 11 commits into from
May 6, 2024

Conversation

bamx23
Copy link
Collaborator

@bamx23 bamx23 commented May 3, 2024

This PR quickly fixes unit tests as a whole by disabling the parts that are broken. It's better to keep running the remaining working tests then not running them at all.

Package.swift Show resolved Hide resolved
Tests/KSCrashRecordingCoreTests/KSObjC_Tests.m Outdated Show resolved Hide resolved
Tests/KSCrashRecordingTests/KSCrashReportFixer_Tests.m Outdated Show resolved Hide resolved
@GLinnik21 GLinnik21 mentioned this pull request May 3, 2024
11 tasks
@GLinnik21
Copy link
Collaborator

Strange. swift build fails with

2024-05-04T12:20:36.2050880Z /Users/runner/work/KSCrash/KSCrash/Sources/KSCrashRecording/Monitors/KSCrashMonitor.h:41:1: error: import of C++ module 'KSCrashRecordingCore' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]

Locally (on release-2.0) builds fine.

@GLinnik21 GLinnik21 linked an issue May 4, 2024 that may be closed by this pull request
11 tasks
@bamx23 bamx23 mentioned this pull request May 5, 2024
@bamx23 bamx23 changed the base branch from release-2.0 to fix-extern-c May 5, 2024 17:29
@GLinnik21 GLinnik21 changed the base branch from fix-extern-c to release-2.0 May 5, 2024 21:53
@GLinnik21
Copy link
Collaborator

It seems that it is not a trivial task to run swift test on iOS simulators. Looks like this toolchain is designed to build and test for and on the local machine. Swift forums suggest using xcodebuild for a case like we have.
https://forums.swift.org/t/i-made-a-little-swiftpm-package-that-uses-uikit-how-can-i-run-tests-from-command-line/50399
https://forums.swift.org/t/swiftpm-and-library-unit-testing/26255

@bamx23 bamx23 force-pushed the fix-tests-crashing branch 2 times, most recently from 9dfa6b9 to 19f0f0e Compare May 6, 2024 09:49
Copy link
Collaborator

@GLinnik21 GLinnik21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!
Just update the xcodebuild action to the latest version and we're good to go.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: mxcl/xcodebuild@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Comment on lines -14 to +31
config: ''
config: ""
- platform: iOS
config: '--use-libraries'
config: "--use-libraries"
- platform: iOS
config: '--use-libraries --use-modular-headers'
config: "--use-libraries --use-modular-headers"
- platform: iOS
config: '--use-static-frameworks'
config: "--use-static-frameworks"
- platform: macOS
config: ''
config: ""
- platform: tvOS
config: ''
config: ""
- platform: watchOS
config: ''
config: ""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GLinnik21 FYI: These changes are generated by VSCode auto-format-on-save. Hope you don't mind

@bamx23 bamx23 requested a review from GLinnik21 May 6, 2024 12:38
Copy link
Collaborator

@GLinnik21 GLinnik21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it seems the problem persists in the version 2 of xcodebuild action as well.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: mxcl/xcodebuild@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

@bamx23
Copy link
Collaborator Author

bamx23 commented May 6, 2024

Great! Just update the xcodebuild action to the latest version and we're good to go.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: mxcl/xcodebuild@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Had to make a fork and fixed version of Node there: mxcl/xcodebuild#103. Once PR is accepted we can switch back to upstream.

@bamx23 bamx23 changed the title [V2] Quick fix unit tests Fix unit tests and add CI jobs May 6, 2024
@GLinnik21 GLinnik21 merged commit 842dc9c into release-2.0 May 6, 2024
12 checks passed
@GLinnik21 GLinnik21 deleted the fix-tests-crashing branch May 6, 2024 13:26
@GLinnik21 GLinnik21 removed a link to an issue May 24, 2024
11 tasks
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