Skip to content

Run tests on macOS and Windows and fix the Windows failures - #142

Merged
timkpaine merged 3 commits into
mainfrom
test-on-macos-and-windows
Nov 14, 2026
Merged

timkpaine merged 3 commits into
mainfrom
test-on-macos-and-windows

Conversation

@timkpaine

@timkpaine timkpaine commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Description

The build job ran on Ubuntu only, so the MSVC code and the Windows import library handling for depends had no CI coverage. This adds one macOS job and one Windows job on Python 3.11 and sets up the MSVC environment with actions-ext/cpp/setup. Lint, checks, and the test result comment stay on Linux, and one failing job no longer cancels the others.

The first Windows run passed the depends test and failed 13 others. Three of the causes were bugs in hatch-cpp:

  • The CMake toolchain passed -G "Visual Studio 17 2022" on Windows unless CMAKE_GENERATOR was set. The windows-2025 runner image has Visual Studio 2026 only, so configure failed. hatch-cpp now passes -G only when CMAKE_GENERATOR is set, and CMake picks the newest installed Visual Studio otherwise.
  • A vcpkg root in a subdirectory was compared with its .gitmodules path using backslashes, so the configured branch was ignored on Windows.
  • POSIX vcpkg commands and Emscripten object paths were built with backslashes on a Windows host.

The other failures were tests that assumed a POSIX host. The vcpkg tests that assert POSIX commands now pin a Linux host, and the fixture that selects the gcc toolchain is skipped on Windows because clang rejects -fPIC for MSVC targets.

Results: 110 passed on macOS, 108 passed and 2 skipped on Windows.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup
  • CI / build configuration
  • Other (describe below)

Checklist

  • Linting passes (make lint)
  • Tests pass (make test)
  • New tests added for new functionality
  • Documentation updated (if applicable)
  • Changelog / version bump (if applicable)

The build job ran on Ubuntu only, so the MSVC code and the Windows import library handling for depends had no CI coverage. Add one macOS and one Windows job on Python 3.11, set up the MSVC environment, and keep lint, checks, and the test result comment on Linux.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

110 tests  ±0   110 ✅ ±0   1m 18s ⏱️ +8s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 47cf71c. ± Comparison against base commit c442d47.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.71%. Comparing base (c442d47) to head (47cf71c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
+ Coverage   96.31%   97.71%   +1.40%     
==========================================
  Files          16       16              
  Lines        1574     1578       +4     
==========================================
+ Hits         1516     1542      +26     
+ Misses         58       36      -22     

☔ 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.

The CMake toolchain passed -G "Visual Studio 17 2022" on Windows unless CMAKE_GENERATOR was set. The windows-2025 runner image has Visual Studio 2026 only, so configure failed with "could not find any instance of Visual Studio". Pass -G only when CMAKE_GENERATOR is set and use CMake's default otherwise, which is the newest installed Visual Studio.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
A vcpkg root in a subdirectory was compared with its .gitmodules path using backslashes on Windows, so the configured branch was ignored. POSIX vcpkg commands and Emscripten object paths were also built with backslashes when the host was Windows.

The vcpkg tests that assert POSIX commands pin a Linux host, the gcc toolchain fixture is skipped on Windows, and the build matrix no longer cancels the other jobs when one fails.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine timkpaine changed the title Run tests on macOS and Windows Run tests on macOS and Windows and fix the Windows failures Nov 13, 2026
@timkpaine
timkpaine marked this pull request as ready for review November 13, 2026 23:38
@timkpaine
timkpaine merged commit 36e84e2 into main Nov 14, 2026
9 checks passed
@timkpaine
timkpaine deleted the test-on-macos-and-windows branch November 14, 2026 00:23
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