Skip to content

chore: add windows CSE helpers file - #9194

Open
Tim Wright (timmy-wright) wants to merge 3 commits into
mainfrom
timmy/helpers
Open

chore: add windows CSE helpers file#9194
Tim Wright (timmy-wright) wants to merge 3 commits into
mainfrom
timmy/helpers

Conversation

@timmy-wright

Copy link
Copy Markdown
Contributor

Add and wire up windows CSE helpers file

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   13 suites   53s ⏱️
395 tests 395 ✅ 0 💤 0 ❌
398 runs  398 ✅ 0 💤 0 ❌

Results for commit a383e2d.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a shared helpers.ps1 module for the Windows CSE scripts package and wires it into the staged CSE function scripts so common routines can be reused across files. It also adds initial Pester coverage for the helpers and updates the Windows CSE README with example local test commands.

Changes:

  • Add staging/cse/windows/helpers.ps1 (common helper functions) and dot-source it from all.ps1 and several CSE function script files.
  • Add helpers.tests.ps1 with Pester tests for Remove-ServiceIfExists.
  • Update staging/cse/windows/README with example Invoke-Pester commands.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
staging/cse/windows/helpers.ps1 New shared helper functions for Windows CSE scripts.
staging/cse/windows/helpers.tests.ps1 New Pester tests validating Remove-ServiceIfExists behavior.
staging/cse/windows/all.ps1 Dot-sources helpers.ps1 before the other function scripts.
staging/cse/windows/configfunc.ps1 Dot-sources helpers.ps1 to make shared helpers available.
staging/cse/windows/containerdfunc.ps1 Dot-sources helpers.ps1 to make shared helpers available.
staging/cse/windows/kubeletfunc.ps1 Dot-sources helpers.ps1 to make shared helpers available.
staging/cse/windows/windowsciliumnetworkingfunc.ps1 Dot-sources helpers.ps1 and fixes minor whitespace in hashtable.
staging/cse/windows/README Adds example local commands for running the Pester test suites.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread staging/cse/windows/helpers.tests.ps1 Outdated
Comment thread staging/cse/windows/helpers.ps1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

staging/cse/windows/helpers.tests.ps1:7

  • helpers.tests.ps1 stubs Get-Service for non-Windows test runs, but sc.exe is also Windows-only and is mocked later. To keep the stated goal of running these tests in isolation on non-Windows, add a no-op sc.exe function stub so Pester can reliably Mock it even when the native binary isn't present.
    # Get-Service is a Windows-only cmdlet; stub it so Mock can override it when
    # tests run in isolation (e.g. locally on non-Windows, outside the full suite).
    function Get-Service {}

- Stub sc.exe alongside Get-Service so tests can Mock it in isolation
  off-Windows.
- Extract the path-qualified nssm.exe call into a mockable
  Invoke-NssmExe wrapper (Pester can't intercept path-qualified
  invocations) and add success/failure tests for Invoke-Nssm.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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.

2 participants