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)
This commit is contained in:
NexusOne23 2025-12-09 05:50:52 +01:00
parent d8e49ddeb1
commit 745d808771
9 changed files with 40 additions and 25 deletions

View file

@ -2,6 +2,7 @@ Describe "SecurityBaseline Integration Tests" {
BeforeAll {
$script:ModulePath = Join-Path $PSScriptRoot "..\..\Modules\SecurityBaseline"
$script:ManifestPath = Join-Path $script:ModulePath "SecurityBaseline.psd1"
$script:IsCI = $env:GITHUB_ACTIONS -eq 'true' -or $env:CI -eq 'true'
}
Context "Module Structure" {
@ -25,7 +26,8 @@ Describe "SecurityBaseline Integration Tests" {
}
Context "DryRun Execution" {
It "Should run in DryRun mode without errors" {
It "Should run in DryRun mode without errors" -Skip:$script:IsCI {
# Skip on CI - requires admin rights and registry access
{ Invoke-SecurityBaseline -DryRun -ErrorAction Stop } | Should -Not -Throw
}
}