Skip to content

Improve reusable TestCase and Swift Testing integration - #2

Open
kudit wants to merge 107 commits into
mainfrom
agent/improve-test-infrastructure
Open

Improve reusable TestCase and Swift Testing integration#2
kudit wants to merge 107 commits into
mainfrom
agent/improve-test-infrastructure

Conversation

@kudit

@kudit kudit commented Jul 26, 2026

Copy link
Copy Markdown
Owner

What changed

This PR modernizes Compatibility's reusable test infrastructure, debugging/threading helpers, and Xcode test integration.

  • Added the Compatibility Testing Library and ModuleTestEntry so reusable TestCases appear as named parameterized Swift Testing cases in SwiftPM and Xcode.
  • Unified reusable test execution through one lifecycle with explicit parallel/serialized behavior, source-aware failures, and reliable cleanup of mutable debug settings.
  • Consolidated debug formatting/source context and kept debug logging callable without requiring main-actor isolation.
  • Corrected main so the helper itself can be called from any thread while only its closure is main-actor isolated; full-runtime WebAssembly uses real Swift concurrency for MainActor scheduling.
  • Removed misleading WASM/Embedded fallbacks for sleep, background, and delay; those APIs are now omitted there rather than silently providing incorrect semantics. main remains available on full-runtime WASM but is omitted for Embedded Swift.
  • Reworked the Xcode test setup so SwiftPM owns the unit-test target while the Xcode project adds UI tests, eliminating duplicate CompatibilityTests.xctest products and exposing parameterized cases in the Test Navigator.
  • Expands UI coverage across the demo tabs and adds focused unit coverage for high-value gaps.
  • Targets v1.19.0 to reflect the broader testing/concurrency cleanup while remaining source-compatible for normally supported platforms.

Validation before merge

  • Run swift test and confirm all reusable module parameter cases pass.
  • Run the shared CompatibilityTest Xcode scheme and confirm both package tests and CompatibilityUITests pass.
  • Re-run code coverage after the expanded UI and focused unit tests.
  • Run supported-platform / Swift Package Index validation before tagging v1.19.0.

Follow-up

After release, Device can import CompatibilityTesting and replace its duplicated module-test adapter with ModuleTestEntry.

@kudit
kudit force-pushed the agent/improve-test-infrastructure branch from 20d8a11 to c6c86f1 Compare July 26, 2026 02:08
kudit added 27 commits July 27, 2026 10:32
Fix test infrastructure availability
Simplified code duplication and context description.
Refactor lastPathComponent to support Windows-style paths and remove Foundation dependency.
Added guidelines for collaborative coding workflow to improve interaction with maintainers.
Added testing requirements and TODOs for release preparation.
fix @available where macOS 12 was paired with watchOS 8
kudit added 30 commits August 14, 2026 22:17
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.

1 participant