Skip to content

ci: run the Windows unit and Pester suites on every pull request - #168

Open
tas50 wants to merge 1 commit into
mainfrom
ci/windows-and-pester-suites
Open

ci: run the Windows unit and Pester suites on every pull request#168
tas50 wants to merge 1 commit into
mainfrom
ci/windows-and-pester-suites

Conversation

@tas50

@tas50 tas50 commented Aug 30, 2026

Copy link
Copy Markdown
Member

What this does

CI for this driver had two holes that mattered more here than they would elsewhere, because this plugin only ever runs on Windows.

  1. The shared lint-unit workflow runs RSpec on Ubuntu only. Nothing verified the driver on the one platform it actually ships to.
  2. spec/powershell holds 45 Pester tests covering the functions in support/hyperv.ps1, complete with a stub Hyper-V module so they run anywhere. They have never run in CI — only on a developer's laptop via bundle exec rake pester.

This adds two jobs:

  • windows-unitbundle exec rake test on windows-latest, Ruby 3.1 and 3.4. File.join, Dir.exist? and the WOW64 architecture detection in powershell.rb all behave differently on Windows, and none of that was exercised.
  • pester — runs spec/powershell/run_tests.ps1 on windows-latest. It needs no bundle, just Pester 5, and uploads the NUnit results as an artifact.

Why there is no kitchen test job

I looked at adding real integration suites the way kitchen-docker has them, and it is not possible on GitHub-hosted runners: Hyper-V requires nested virtualization, which hosted runners do not provide, and the Hyper-V role cannot be enabled on them. Inventing a suite that cannot run would be worse than not having one, so instead the workflow now carries a comment saying exactly that, and points at the "Manual testing against Hyper-V" section of CONTRIBUTING.md, which is where end-to-end verification actually lives.

If we ever get a self-hosted Hyper-V runner, that is the point to add a kitchen test job.

Dead code removed

support/ci/windows_ci.bat and support/ci/windows_integration.bat are both gone. Nothing in the repo referenced either file. windows_ci.bat duplicated what the new jobs do, and windows_integration.bat could not have worked at all — it ran bundle exec kitchen verify windows against a kitchen.yml this repo does not have, using %machine_user% and %machine_pass% that nothing sets.

Verification

$ bundle exec rake test
120 examples, 0 failures

$ bundle exec cookstyle --chefstyle
12 files inspected, no offenses detected

$ bundle exec rake pester
Tests Passed: 45, Failed: 0, Skipped: 0

The shared lint-unit workflow only runs the RSpec suite on Ubuntu, and the
Pester suite in spec/powershell never ran anywhere except a developer's
laptop. This driver only ever runs on Windows, so neither gap was harmless.

Adds two jobs:

- windows-unit runs `rake test` on windows-latest against Ruby 3.1 and 3.4.
  File.join, Dir.exist? and the WOW64 architecture detection in powershell.rb
  all behave differently there, and none of it was covered.
- pester runs spec/powershell/run_tests.ps1 on windows-latest, which exercises
  the 45 tests over support/hyperv.ps1 against the stub Hyper-V module. It
  needs no bundle, just Pester 5.

Also records at the top of the workflow why there is no `kitchen test` job:
Hyper-V needs nested virtualization, which GitHub-hosted runners do not offer,
so end-to-end coverage stays a manual step documented in CONTRIBUTING.md.

Removes support/ci/windows_ci.bat and support/ci/windows_integration.bat.
Nothing referenced either one. windows_ci.bat duplicated what these jobs now
do, and windows_integration.bat could not have worked: it called
`kitchen verify windows` against a kitchen.yml this repo does not have, using
%machine_user% and %machine_pass% that nothing sets.

Signed-off-by: Tim Smith <tim@mondoo.com>
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