diff --git a/src/PSRepositoryReleaseManager/PSRepositoryReleaseManager.Tests.ps1 b/src/PSRepositoryReleaseManager/PSRepositoryReleaseManager.Tests.ps1 index 63f516e..6b4819d 100644 --- a/src/PSRepositoryReleaseManager/PSRepositoryReleaseManager.Tests.ps1 +++ b/src/PSRepositoryReleaseManager/PSRepositoryReleaseManager.Tests.ps1 @@ -9,7 +9,40 @@ Describe "PSRepositoryReleaseManager" -Tag 'Integration' { } AfterEach { } - It "Runs Invoke-Generate.ps1 -ReleaseTagRef -ReleaseNotesVariant -ReleaseNotesPath" { + It "Runs Invoke-Generate.ps1 -ReleaseTagRef" { + $stdout = ../src/scripts/ci/Invoke-Generate.ps1 -ReleaseTagRef $env:RELEASE_TAG_REF + "Generate notes content:" | Write-Verbose + Get-Content -Path "$stdout" | Out-String -Stream | % { $_.Trim() } | ? { $_ } | Write-Host + } + It "Runs Invoke-Generate.ps1 -ProjectDirectory -ReleaseTagRef" { + $private:ProjectDir = "$(git rev-parse --show-toplevel)" + + $stdout = ../src/scripts/ci/Invoke-Generate.ps1 -ProjectDirectory $private:ProjectDir -ReleaseTagRef $env:RELEASE_TAG_REF + "Generate notes content:" | Write-Verbose + Get-Content -Path "$stdout" | Out-String -Stream | % { $_.Trim() } | ? { $_ } | Write-Host + } + It "Runs Invoke-Generate.ps1 -ReleaseTagRef -ReleaseNotesVariant" { + $env:RELEASE_NOTES_VARIANT = 'Changes-HashSubject-NoMerges' + + $stdout = ../src/scripts/ci/Invoke-Generate.ps1 -ReleaseTagRef $env:RELEASE_TAG_REF -ReleaseNotesVariant $env:RELEASE_NOTES_VARIANT + "Generate notes content:" | Write-Verbose + Get-Content -Path "$stdout" | Out-String -Stream | % { $_.Trim() } | ? { $_ } | Write-Host + } + It "Runs Invoke-Generate.ps1 -ReleaseTagRef -ReleaseNotesPath (full)" { + $env:RELEASE_NOTES_PATH = "$(git rev-parse --show-toplevel)/.release-notes.fullpath.md" + + $stdout = ../src/scripts/ci/Invoke-Generate.ps1 -ReleaseTagRef $env:RELEASE_TAG_REF -ReleaseNotesPath $env:RELEASE_NOTES_PATH + "Generate notes content:" | Write-Verbose + Get-Content -Path "$stdout" | Out-String -Stream | % { $_.Trim() } | ? { $_ } | Write-Host + } + It "Runs Invoke-Generate.ps1 -ReleaseTagRef -ReleaseNotesPath (relative)" { + $env:RELEASE_NOTES_PATH = ".release-notes.relativepath.md" + + $stdout = ../src/scripts/ci/Invoke-Generate.ps1 -ReleaseTagRef $env:RELEASE_TAG_REF -ReleaseNotesPath $env:RELEASE_NOTES_PATH + "Generate notes content:" | Write-Verbose + Get-Content -Path "$stdout" | Out-String -Stream | % { $_.Trim() } | ? { $_ } | Write-Host + } + It "Runs Invoke-Generate.ps1 -ReleaseTagRef -ReleaseNotesVariant -ReleaseNotesPath (all variants)" { $ReleaseNotesVariant = Get-ChildItem "../src/PSRepositoryReleaseManager/generate/variants" | % { $_.BaseName } "Release notes variants:" | Write-Verbose $ReleaseNotesVariant | Write-Host