Skip to content

Improve reusable TestCase and Swift Testing integration - #2

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

Improve reusable TestCase and Swift Testing integration#2
kudit wants to merge 56 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 and related diagnostics while preserving the existing in-app TestCase model.

Reusable test execution

  • Unifies TestCase.execute() and live-UI execution through one lifecycle implementation.
  • Preserves async setup/test/teardown behavior and detailed source-aware failures.
  • Adds explicit parallel/serialized execution behavior for tests that mutate process-global state.
  • Restores mutable debug settings with test-local defer even when expectations throw.

Swift Testing integration

  • Adds the Compatibility Testing Library product.
  • Adds ModuleTestEntry, adapting each reusable TestCase into a parameterized Swift Testing case with stable identity and readable descriptions.
  • Keeps infrastructure-only target tests separate from reusable module tests.
  • Updates the Development Xcode test configuration so the shared CompatibilityTest scheme runs both unit and UI test bundles with code coverage enabled.

Debug/source-context cleanup

  • Consolidates debug processing around DebugFormatContext and SourceContext.
  • Keeps direct #file / #function / #line / #column capture at public call boundaries while forwarding a single SourceContext internally.
  • Uses the structured debug formatter as the canonical formatting path while retaining legacy compatibility adapters where appropriate.

Threading portability

  • Removes misleading WASM/Embedded fallbacks for main, background, sleep, and delay when Compatibility cannot provide the advertised scheduling/timing semantics.
  • Supported threaded runtimes continue to use real actor/task/dispatch behavior.

Package/version cleanup

  • Synchronizes the pending release surfaces at v1.18.3.
  • Expands contributor guidance and release/test documentation.

Validation before merge

  • Run swift test and confirm all reusable module parameter cases pass.
  • Run the shared CompatibilityTest Xcode scheme and confirm both CompatibilityTests and CompatibilityUITests are discovered and pass.
  • Confirm parameterized test cases are visible/selectively runnable in Xcode after the scheme update.
  • Review code coverage for meaningful non-UI gaps.
  • Run supported-platform / Swift Package Index validation before tagging v1.18.3.

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
kudit marked this pull request as ready for review August 4, 2026 17:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae7c4eef2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Core/Debug.swift Outdated
Comment thread Sources/Core/Test.swift Outdated
@kudit
kudit force-pushed the agent/improve-test-infrastructure branch from 423233a to a0a5162 Compare August 12, 2026 15:09
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