Skip to content

Harden WinRT golden regression harness and E2E runners - #66

Merged
leileizhang (lei9444) merged 9 commits into
microsoft:mainfrom
yeelam-gordon:test/winrt-regression-harness
Sep 4, 2026
Merged

leileizhang (lei9444) merged 9 commits into
microsoft:mainfrom
yeelam-gordon:test/winrt-regression-harness

Conversation

@yeelam-gordon

@yeelam-gordon Gordon Lam (yeelam-gordon) commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The core portable WinRT golden harness originally proposed here already landed on main through #65 (181af5a). This PR now merges current main and retains only incremental hardening for that harness and the current tests/e2e/runners/ implementations.

  • Gate the Rust integration harness to Windows, use IPropertyValue::IID, and name TYPE_E_TYPEMISMATCH.
  • Require MTA initialization to succeed and balance every successful RoInitialize with RoUninitialize through an RAII guard, including early returns and panic unwinding. RPC_E_CHANGED_MODE is not accepted.
  • Compare every shared Python projected-value semantic attribute (name, value, and path) before declaring equality, with focused scalar/object regressions.
  • Support the schema's constructor instantiate kind in the TypeScript runner and reject unknown kinds instead of continuing with a null object, while preserving existing activation, factory, and NotificationData behavior.
  • Keep the current tests/e2e/runners/ layout; obsolete tests/runners/ files are not restored.

Validation

  • cargo test -p dynwinrt --test winrt_regression — 1 passed
  • cargo test -p dynwinrt — 277 unit tests passed, 1 ignored; integration test passed
  • python -m pytest tests\e2e\runners\test_py_runner.py -q — 2 passed
  • TypeScript runner strict typecheck with tsc --noEmit — passed
  • tsx --test tests\e2e\runners\ts_runner.test.ts — 2 passed
  • cargo fmt --all -- --check — passed
  • Final diff checks against current main — passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot review (PR #3): projected_values_equal returned after the FIRST shared
attribute (name/value/path) matched, so an object exposing more than one of them
(e.g. both .name and .value) could be treated as equal when only the first matches,
weakening the regression protocol checks. Compare every shared attribute and return
False if any differ; keep the scalar-equality fallback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nown kinds

Copilot review: the E2E spec schema includes instantiate.kind 'constructor' (py_runner
already handles it), but ts_runner only handled 'activate'/'static_factory', leaving obj
null and proceeding for 'constructor' or any unexpected kind — which could report a pass
with no object. Add the 'constructor' branch (new cls(...args), mirroring py_runner) and
throw on unknown kinds. (The current constructor spec is py-only, so no ts behavior
changes today; this is defensive.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…D_MODE in init

Copilot review (PR #3):
- winrt_regression.rs uses WinRT/Win32 APIs (RoInitialize etc.) and won't compile on
  non-Windows; add #![cfg(windows)] so cargo test stays usable off-Windows.
- init_winrt ignored ALL RoInitialize failures despite the comment saying only the
  already-initialized case is benign. Now it accepts only RPC_E_CHANGED_MODE (already
  initialized in a different apartment; S_FALSE is already Ok) and panics on any other
  HRESULT so a genuine init failure is diagnosable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aw literal

Copilot review (PR #3): the golden-behavior harness asserted against a raw
0x80028CA0 HRESULT literal. Name it TYPE_E_TYPEMISMATCH locally (GetString on a
non-string IPropertyValue) for readability/maintainability.
The earlier ts_runner 'constructor' handling compared instKind against a literal not
in the Instantiate.kind union ('activate' | 'static_factory' | 'none'), which a
type-checked (tsc) run rejects as TS2367 (no overlap). Extend the union to include
'constructor'.
Resolve the stale runner paths in favor of the current tests/e2e layout, balance WinRT apartment initialization, and add focused runner regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@lei9444 leileizhang (lei9444) changed the title Add WinRT regression test harness (portable golden net) Harden WinRT golden regression harness and E2E runners Sep 4, 2026
@lei9444
leileizhang (lei9444) merged commit f8b6fdf into microsoft:main Sep 4, 2026
24 checks passed
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.

3 participants