Skip to content

Revive AvmcIfc test server - Enable dead tests on CI. - #998

Merged
junkmd merged 3 commits into
enthought:mainfrom
junkmd:revive_avmc
Nov 19, 2026
Merged

junkmd merged 3 commits into
enthought:mainfrom
junkmd:revive_avmc

Conversation

@junkmd

@junkmd junkmd commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Part of #572

Summary

This PR moves the AvmcIfc test server sources and pre-built DLLs to a dedicated directory, adds CI steps to register/unregister the server, and makes tests skip gracefully when the server is not available.
This enables previously dead tests to run on GitHub Actions CI.

Why

Some tests require the AvmcIfc COM server to be registered.
For a long time, these tests were skipped or failed on CI because the DLL was not registered.
This made it impossible to verify that the code works correctly.

This PR:

  1. Moves Avmc sources from source/ to source/Avmc/ (including pre-built DLLs)
  2. Adds CI steps to register/unregister AvmcIfc.dll and AvmcIfc_x64.dll
  3. Updates test_avmc.py to skip tests cleanly when the type library is not registered

About the AvmcIfc test server

The AvmcIfc inproc server is a simple test double implemented in source/Avmc/Avmc.cpp and source/Avmc/AvmcIfc.cpp. It:

  • Provides a single COM interface IAvmc with one method FindAllAvmc
  • Returns a SAFEARRAY of DeviceInfo structures (VT_RECORD)
  • The data is hardcoded
  • Does not communicate with any external hardware or network - it is purely a qualitative test server for marshaling SAFEARRAY of structures
  • Used to test VT_ARRAY | VT_RECORD marshaling in comtypes

What this PR does NOT do

  • Does not add DLLs to the package distribution - The DLLs are only for testing. They are in source/ not in comtypes/. The MANIFEST.in and pyproject.toml do not include them.
  • Does not build AvmcIfc from source in CI - The workflow uses pre-built DLLs. Building from source is future work.
  • Does not fix register_server() for local development - The function in comtypes/test/__init__.py still expects the DLL at source/Avmc/Debug/. Local developers must build it themselves or get it from CI artifacts.

Test impact

Tests that were previously skipped or failed due to missing AvmcIfc will now run on CI:

  • test_avmc.py (now skips cleanly if not registered, runs if registered)

Out of scope

  • Building AvmcIfc.dll from source in CI (separate PR)
  • Making register_server() work without pre-built DLLs (separate PR)
  • Adding the DLL to the wheel/sdist (never - it is test-only)

@junkmd junkmd added this to the 1.5.1 milestone Nov 18, 2026
@junkmd junkmd added the tests enhance or fix tests label Nov 18, 2026
@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.91%. Comparing base (fd37c96) to head (549b892).

Files with missing lines Patch % Lines
comtypes/test/test_avmc.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #998      +/-   ##
==========================================
+ Coverage   91.84%   91.91%   +0.06%     
==========================================
  Files         150      150              
  Lines       15668    15674       +6     
==========================================
+ Hits        14390    14406      +16     
+ Misses       1278     1268      -10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@junkmd
junkmd merged commit af06669 into enthought:main Nov 19, 2026
199 of 202 checks passed
@junkmd
junkmd deleted the revive_avmc branch November 19, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants