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

Introduce SpeziTesting library and migrate some tests to Swift Testing #122

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Mar 9, 2025

Introduce SpeziTesting library and migrate some tests to Swift Testing

♻️ Current situation & Problem

This PR starts the effort of replacing XCTest with Swift Testing. We replaced the XCTSpezi library with SpeziTesting. This can be adopted by anyone even if using with XCTest as just the naming semantics changed.
Secondly, this PR already migrates some of the unit tests to use Swift Testing. Some remain unchanged as we also require the underlying XCTRuntimeAssertions to be updated.

⚙️ Release Notes

  • Introduce SpeziTesting library.
  • Migrate some test to Spezi Testing.

📚 Documentation

--

✅ Testing

--

📝 Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@Supereg Supereg requested a review from PSchmiedmayer March 9, 2025 16:45
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 86.95%. Comparing base (5adc30e) to head (59033d3).

Files with missing lines Patch % Lines
Sources/XCTSpezi/Exports.swift 0.00% 6 Missing ⚠️
Sources/Spezi/Spezi/Spezi+Preview.swift 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
- Coverage   87.44%   86.95%   -0.48%     
==========================================
  Files          51       52       +1     
  Lines        1687     1693       +6     
==========================================
- Hits         1475     1472       -3     
- Misses        212      221       +9     
Files with missing lines Coverage Δ
Sources/SpeziTesting/DependencyResolution.swift 64.71% <ø> (ø)
Sources/Spezi/Spezi/Spezi+Preview.swift 62.97% <0.00%> (ø)
Sources/XCTSpezi/Exports.swift 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5adc30e...59033d3. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for all the work here!

Would be amazing to see if and how we can transition XCRuntimeAssertions to support Swift Testing to transition the remaining tests. I am wondering what a good approach around this would look like; I created SwiftTestingExtensions a while and am wondering if this should move in there and/or if we just rename/update XCRuntimeAssertions to also support Swift Testing in a nice way?

@PSchmiedmayer PSchmiedmayer added enhancement New feature or request test Test improvements labels Mar 9, 2025
@Supereg
Copy link
Member Author

Supereg commented Mar 9, 2025

Thank you for all the work here!

Would be amazing to see if and how we can transition XCRuntimeAssertions to support Swift Testing to transition the remaining tests. I am wondering what a good approach around this would look like; I created SwiftTestingExtensions a while and am wondering if this should move in there and/or if we just rename/update XCRuntimeAssertions to also support Swift Testing in a nice way?

I would probably rename XCTRuntimeAssertions to just RuntimeAssertions and make it support both XCTest and Swift Testing. Aiming to submit a PR for that soon.

@PSchmiedmayer
Copy link
Member

Sound like a great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test Test improvements
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants