Skip to content

Commit

Permalink
Merge pull request #34 from theohbrothers/test/integration-add-more-t…
Browse files Browse the repository at this point in the history
…ests-for-invoke-generate.ps1

Test (integration): Add more tests for `Invoke-Generate.ps1`
  • Loading branch information
joeltimothyoh authored May 11, 2024
2 parents df86389 + af3dc92 commit 6474c0a
Showing 1 changed file with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6474c0a

Please sign in to comment.