noid-privacy/Tests/Integration/Privacy.Integration.Tests.ps1
NexusOne23 745d808771 Fix: Skip execution tests on CI - require admin/Defender
- All DryRun tests now skip on GitHub Actions (no admin rights)
- Fixed AntiAI compliance script path (Private folder)
- Removed continue-on-error - tests are real quality gates again
- Structure tests still run on CI (manifest, exports, JSON validation)
2025-12-09 05:50:52 +01:00

33 lines
1.2 KiB
PowerShell

Describe "Privacy Integration Tests" {
BeforeAll {
$script:ModulePath = Join-Path $PSScriptRoot "..\..\Modules\Privacy"
$script:ManifestPath = Join-Path $script:ModulePath "Privacy.psd1"
$script:IsCI = $env:GITHUB_ACTIONS -eq 'true' -or $env:CI -eq 'true'
}
Context "Module Structure" {
It "Should have module manifest" {
Test-Path $script:ManifestPath | Should -Be $true
}
It "Should load module without errors" {
{ Import-Module $script:ManifestPath -Force -ErrorAction Stop } | Should -Not -Throw
}
It "Should export Invoke-PrivacyHardening function" {
$module = Get-Module Privacy
$module.ExportedFunctions.Keys | Should -Contain "Invoke-PrivacyHardening"
}
}
Context "DryRun Execution" {
It "Should run in DryRun mode with MSRecommended mode without errors" -Skip:$script:IsCI {
# Skip on CI - requires admin rights and registry access
{ Invoke-PrivacyHardening -Mode "MSRecommended" -DryRun -ErrorAction Stop } | Should -Not -Throw
}
}
AfterAll {
Remove-Module Privacy -ErrorAction SilentlyContinue
}
}