Repository navigation
ci: skip Pester when a PR changes no module or test code - #152
Merged
Merged
Conversation
A PR whose changes map to no test file (docs, workflows, tools/) fell through to the full ~1 hour suite. It now passes the required PesterPiHoleShell check in seconds instead. Merges into develop/main only trigger the pipeline when PiHoleShell/ or tests/ changed. Adding a function also ran the full suite, because any change to the UTF-16 manifest counted as a core change. The manifest is now compared the same way as the .psm1: new FunctionsToExport entries only run the changed function's tests, while a removed export or any other manifest change still runs everything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Makes the Pester pipeline run only when functions or tests change.
Why #151 ran the full suite
The pipeline already maps changed files to their tests, but when no test matched (a docs-only PR), it fell back to the full suite instead of skipping it.
Changes (
azuredevops-pihole-pester-tests.yml)PRs with nothing to test skip Pester. That covers docs,
.github/,tools/and the pipeline file itself. The run still reports success, in seconds, becausePesterPiHoleShellis a required check; a path filter on thepr:trigger would leave the check pending and block the merge. Publishing test results is skipped too.Merges into
develop/mainonly start the pipeline whenPiHoleShell/ortests/changed. That's a path filter ontrigger:, which is safe because push builds aren't required checks.Adding a function no longer runs the full suite. The UTF-16 manifest (
.psd1) used to count as a core change every time. It's now compared like.psm1: newFunctionsToExportentries only run the changed function's tests, while a removed export or any other manifest change still runs everything.A changed function with no test file of its own runs the full suite, so it can't end up running nothing. Today that applies to
Remove-PiHoleAuthSessionandSearch-PiHoleListDomain.Unchanged: shared code (
Private/,Request-PiHoleAuth, test helpers) still runs the full suite, and so does any error while working out what changed.Testing
I dry-ran the script's scoping logic locally against real history, with Pester swapped out:
Get-PiHoleApiEndpoint)Get-PiHoleApiEndpoint.Integration.Tests.ps1(was: full suite).psd1.psd1setting (PowerShellVersion)Get-PiHoleInfoVersionGet-PiHoleInfoVersion.Integration.Tests.ps1Search-PiHoleListDomain(no test file)This PR only changes the pipeline file, so its own Pester check should take the new skip path.
🤖 Generated with Claude Code