fix: source Azure DevOps pipeline secrets from the dns3 variable group - #91
Merged
Merged
Conversation
Replaces the placeholder PiHoleTestServer/PiHoleTestToken pipeline variables with a reference to the actual 'dns3' variable group (PiHoleServer, PiHoleToken, PiHoleIgnoreSsl), matching what's really configured in Azure DevOps. PiHoleIgnoreSsl's value is the literal text '$true', so it's substituted unquoted into the generated config script rather than as a quoted string, so it evaluates as a real boolean - verified locally that the dot-sourced result is [bool]$true, not the string "$true". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fix: source Azure DevOps pipeline secrets from the dns3 variable group
…ice flakiness Set-PiHoleDnsBlocking.Tests.ps1 has failed on every run since before this branch existed: it mocked Request-PiHoleAuth and Format-PiHoleSecond, both internal (unexported) helpers, without -ModuleName PiHoleShell, so Pester's Mock couldn't find or intercept them - the module import itself failed with CommandNotFoundException. Rewrote it to mock every internal call (Request-PiHoleAuth, Format-PiHoleSecond, Remove-PiHoleCurrentAuthSession, Invoke-RestMethod) with -ModuleName, use Should -Invoke instead of the deprecated Assert-MockCalled, fix RawOutput being passed as a bare switch when the parameter is [bool] (same issue fixed earlier in the Actions functions), and assert on actual error content instead of an unrealistic Should -Throw (the function's catch block calls Write-Error, which doesn't throw by default). Restart-PiHoleDnsService.Integration.Tests.ps1 restarts the real pihole-FTL service twice back-to-back (once per test), and the CI agent's second call would occasionally hit the service while it was still coming back up. Added a short Start-Sleep before the second restart; confirmed stable over 3 consecutive real-server runs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fix: repair Set-PiHoleDnsBlocking unit test and Restart-PiHoleDnsService flakiness
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.
Summary
Updates
azuredevops-pihole-pester-tests.ymlto pull its Pi-hole server credentials from thedns3variable group in Azure DevOps (PiHoleServer,PiHoleToken,PiHoleIgnoreSsl), replacing the placeholderPiHoleTestServer/PiHoleTestTokenpipeline variables from the original draft.PiHoleIgnoreSsl's value in the group is the literal text$true, so it's substituted unquoted into the generatedtests/IntegrationConfig.local.ps1rather than as a quoted string, so it evaluates as an actual PowerShell boolean.Test plan
$PiHoleIgnoreSslis[bool]$true(not the string"$true") and$PiHoleServeris a[uri]mmadeja-dtagent picks up the group correctly🤖 Generated with Claude Code