Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions 11 src/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -531,16 +531,23 @@ LogGroup 'Calculate Job Run Conditions:' {
# Note: $shouldPrerelease already requires $hasImportantChanges, so no separate check needed.
$shouldRunBuildTest = $isNotAbandonedPR -and $hasImportantChanges

# Check if setup/teardown scripts exist in the repository
$hasBeforeAllScript = Test-Path -Path 'tests/BeforeAll.ps1'
$hasAfterAllScript = Test-Path -Path 'tests/AfterAll.ps1'
Write-Host "Setup/teardown script detection:"
Write-Host " tests/BeforeAll.ps1 exists: $hasBeforeAllScript"
Write-Host " tests/AfterAll.ps1 exists: $hasAfterAllScript"

# Create Run object with all job-specific conditions
$run = [pscustomobject]@{
LintRepository = $isOpenOrUpdatedPR -and (-not $settings.Linter.Skip)
BuildModule = $shouldRunBuildTest -and (-not $settings.Build.Module.Skip)
TestSourceCode = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.SourceCode)
LintSourceCode = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.SourceCode)
TestModule = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.PSModule)
BeforeAllModuleLocal = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.Module)
BeforeAllModuleLocal = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.Module) -and $hasBeforeAllScript
TestModuleLocal = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.Module)
AfterAllModuleLocal = $true # Always runs if Test-ModuleLocal was not skipped
AfterAllModuleLocal = $shouldRunBuildTest -and ($null -ne $settings.TestSuites.Module) -and $hasAfterAllScript
Comment thread
MariusStorhaug marked this conversation as resolved.
Comment thread
MariusStorhaug marked this conversation as resolved.
GetTestResults = $shouldRunBuildTest -and (-not $settings.Test.TestResults.Skip) -and (
($null -ne $settings.TestSuites.SourceCode) -or ($null -ne $settings.TestSuites.PSModule) -or ($null -ne $settings.TestSuites.Module)
)
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.