Skip to content

Ensure that unit tests can be executed under version of Windows different than the one used for building NVDA#12835

Merged
seanbudd merged 3 commits intonvaccess:masterfrom
lukaszgo1:comtypesInUnitTests
Sep 13, 2021
Merged

Ensure that unit tests can be executed under version of Windows different than the one used for building NVDA#12835
seanbudd merged 3 commits intonvaccess:masterfrom
lukaszgo1:comtypesInUnitTests

Conversation

@lukaszgo1
Copy link
Copy Markdown
Contributor

Link to issue number:

None. Regression from #12617 Discovered when working on #12753 as that PR required executing unit tests under various versions of Windows

Summary of the issue:

It is sometimes useful to execute unit tests under various versions of Windows where it is impractical, or even impossible to have full build environment for NVDA. With current master some tests are failing because when importing COM interfaces comtypes complains about them being created on different version of Windows. Before PR #12617 this worked by chance since our monkey patches for compypes were applied when importing core and it just so happened that core was imported before any COM interface was.

Description of how this pull request fixes the issue:

Since we have monkey patch which stops comtypes from complaining about typelib being different than COM interface it has been applied to comtypes before tests starts. To avoid copying code of this monkey patch it was necessary to refactor our monkey patches to make each of them into a separate function - that allows us to apply them selectively rather than just all of them during import.

Testing strategy:

  • Ensured that unit tests pass under a never version of Windows than the one under which virtual environment for NVDA has been created
  • Ensured that comtypes monkey patches are properly applied for NVDA in particular that core.CallCancelled is raised when appropriate.

Known issues with pull request:

None known

Change log entries:

None needed.

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • API is compatible with existing addons.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

@lukaszgo1 lukaszgo1 marked this pull request as ready for review September 12, 2021 16:59
@lukaszgo1 lukaszgo1 requested a review from a team as a code owner September 12, 2021 16:59
@lukaszgo1 lukaszgo1 requested a review from seanbudd September 12, 2021 16:59
@seanbudd
Copy link
Copy Markdown
Member

@michaelDCurran I've requested your review here as I'm not certain of the implications of changes to comtypesMonkeyPatches.

Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

These changes generally look good to me - I am concerned if there are any issues with addon compatibility breaking with the refactor to comtypesMonkeyPatches.

Copy link
Copy Markdown
Member

@michaelDCurran michaelDCurran left a comment

Choose a reason for hiding this comment

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

This restructuring looks okay to me. I don't have any concirns that this would break add-ons either.
I have not done a thorough review of all moved code though, I just looked at the structure.

@seanbudd seanbudd merged commit 9f671ba into nvaccess:master Sep 13, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Sep 13, 2021
@lukaszgo1 lukaszgo1 deleted the comtypesInUnitTests branch September 13, 2021 07:44
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.

4 participants