Skip to content

fix: resolve skipped Pester tests#7

Merged
Dashtid merged 3 commits intomainfrom
fix/resolve-skipped-tests
Dec 26, 2025
Merged

fix: resolve skipped Pester tests#7
Dashtid merged 3 commits intomainfrom
fix/resolve-skipped-tests

Conversation

@Dashtid
Copy link
Owner

@Dashtid Dashtid commented Dec 26, 2025

Summary

  • Enable SSH agent service in CI workflow before Windows tests
  • Remove -Skip from SupportsShouldProcess test block (feature already implemented in all 4 Tier 3 scripts)
  • Update private IPs test to use AST-based detection (allows IPs in comments/strings but rejects in code)
  • Add Test-NoPrivateIPsInCode helper function to TestHelpers.psm1

Test plan

  • CI passes with SSH agent tests running instead of skipping
  • SupportsShouldProcess tests run and pass for Backup-BrowserProfiles, Manage-VPN, Manage-WSL, Manage-Docker
  • Private IPs test runs with smart detection
  • Expected result: ~2-3 conditional skips (Windows Update, Defender, script existence) which is appropriate behavior

- Enable SSH agent service in CI workflow before Windows tests
- Remove -Skip from SupportsShouldProcess test block (feature already implemented)
- Update private IPs test to use AST-based detection (allows IPs in comments/strings)
- Add Test-NoPrivateIPsInCode helper function to TestHelpers.psm1

This reduces skipped tests from 11 to ~2-3 conditional skips which is
appropriate behavior for integration tests that require specific services.
@github-actions
Copy link

github-actions bot commented Dec 26, 2025

Linux Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit ebd22c0. ± Comparison against base commit 85955f9.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 26, 2025

Windows Test Results

961 tests  ±0   961 ✅ +11   26s ⏱️ ±0s
270 suites ±0     0 💤  - 11 
  1 files   ±0     0 ❌ ± 0 

Results for commit ebd22c0. ± Comparison against base commit 85955f9.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
Security Integration Tests.No Secrets in Repository.No scripts contain private IPs (except examples)
Security Integration Tests.No Secrets in Repository.No scripts contain private IPs in executable code

♻️ This comment has been updated with latest results.

The tests were failing because the script paths were not available
during test execution when running with -TagFilter. Changed from
using a foreach loop (which runs during discovery) to Pester 5's
-ForEach parameter with BeforeDiscovery for proper data-driven tests.
- Add SSH agent setup step to test-scripts.yml workflow
- Change -Skip parameters to Set-ItResult pattern for runtime evaluation
- Tests now properly run when SSH agent is available in CI

The -Skip parameter is evaluated at discovery time, but service checks
need to happen at runtime. Using Set-ItResult inside the test body
allows proper conditional skipping based on actual service state.
@Dashtid Dashtid merged commit 21d02b8 into main Dec 26, 2025
35 checks passed
@Dashtid Dashtid deleted the fix/resolve-skipped-tests branch December 26, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant