File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ BeforeAll {
2222 if (-not $id ) {
2323 throw ' GITHUB_RUN_ID is required for Actions tests because it is used to build repository-scoped names for OIDC operations.'
2424 }
25- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
2625}
2726
2827Describe ' Actions' {
@@ -62,9 +61,16 @@ Describe 'Actions' {
6261 if ($OwnerType -in (' repository' , ' enterprise' )) {
6362 $repo = $null
6463 } else {
65- # Declarative get-or-create so partial reruns (issue #590) can rebuild
66- # the shared repository if AfterAll already tore it down.
67- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType $OwnerType - Name $repoName
64+ $repoParams = @ {
65+ Name = $repoName
66+ AddReadme = $true
67+ License = ' mit'
68+ Gitignore = ' VisualStudio'
69+ }
70+ $repo = switch ($OwnerType ) {
71+ ' user' { Set-GitHubRepository @repoParams }
72+ ' organization' { Set-GitHubRepository @repoParams - Organization $Owner }
73+ }
6874 Write-Host ($repo | Select-Object * | Out-String )
6975 }
7076 }
Original file line number Diff line number Diff line change 33
44LogGroup ' BeforeAll - Global Test Setup' {
55 $authCases = . " $PSScriptRoot /Data/AuthCases.ps1"
6- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
76 $id = $env: GITHUB_RUN_ID
87 if (-not $id ) {
98 throw ' GITHUB_RUN_ID environment variable is not set. Refusing to create or clean up test repositories with a non-deterministic name.'
@@ -68,15 +67,24 @@ LogGroup 'BeforeAll - Global Test Setup' {
6867 }
6968 }
7069
71- # Provision the primary shared repository via the same idempotent helper that
72- # leaf jobs use, so the happy-path BeforeAll and the partial-rerun self-heal
73- # path (issue #590) follow the same code.
74- Initialize-SharedTestRepository - Owner $Owner - OwnerType $OwnerType - Name $repoName | Out-Null
70+ # Provision the primary shared repository.
71+ $repoParams = @ {
72+ Name = $repoName
73+ AddReadme = $true
74+ License = ' mit'
75+ Gitignore = ' VisualStudio'
76+ }
77+ switch ($OwnerType ) {
78+ ' user' { Set-GitHubRepository @repoParams }
79+ ' organization' { Set-GitHubRepository @repoParams - Organization $Owner }
80+ }
7581
7682 # Provision extra repositories needed by Secrets/Variables SelectedRepository tests.
7783 # Only organization owners need them — those tests are skipped for user owners.
7884 if ($OwnerType -eq ' organization' ) {
79- Initialize-SharedTestRepositoryExtras - Owner $Owner - BaseName $repoName | Out-Null
85+ foreach ($suffix in 2 , 3 ) {
86+ Set-GitHubRepository - Organization $Owner - Name " $repoName -$suffix "
87+ }
8088 }
8189 }
8290 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ BeforeAll {
2626 if (-not $id ) {
2727 throw ' GITHUB_RUN_ID is required for Environments tests.'
2828 }
29- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
3029}
3130
3231Describe ' Environments' {
@@ -52,9 +51,16 @@ Describe 'Environments' {
5251 if ($OwnerType -in (' repository' , ' enterprise' )) {
5352 $repo = $null
5453 } else {
55- # Declarative get-or-create so partial reruns (issue #590) can rebuild
56- # the shared repository if AfterAll already tore it down.
57- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType $OwnerType - Name $repoName
54+ $repoParams = @ {
55+ Name = $repoName
56+ AddReadme = $true
57+ License = ' mit'
58+ Gitignore = ' VisualStudio'
59+ }
60+ $repo = switch ($OwnerType ) {
61+ ' user' { Set-GitHubRepository @repoParams }
62+ ' organization' { Set-GitHubRepository @repoParams - Organization $Owner }
63+ }
5864 }
5965 Write-Host ($repo | Select-Object * | Out-String )
6066 }
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ BeforeAll {
2626 if (-not $id ) {
2727 throw ' GITHUB_RUN_ID must be set for run-scoped release tests.'
2828 }
29- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
3029}
3130
3231Describe ' Releases' {
@@ -51,9 +50,16 @@ Describe 'Releases' {
5150 if ($OwnerType -in (' repository' , ' enterprise' )) {
5251 $repo = $null
5352 } else {
54- # Declarative get-or-create so partial reruns (issue #590) can rebuild
55- # the shared repository if AfterAll already tore it down.
56- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType $OwnerType - Name $repoName
53+ $repoParams = @ {
54+ Name = $repoName
55+ AddReadme = $true
56+ License = ' mit'
57+ Gitignore = ' VisualStudio'
58+ }
59+ $repo = switch ($OwnerType ) {
60+ ' user' { Set-GitHubRepository @repoParams }
61+ ' organization' { Set-GitHubRepository @repoParams - Organization $Owner }
62+ }
5763 }
5864 Write-Host ($repo | Select-Object * | Out-String )
5965 }
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ BeforeAll {
2626 if (-not $id ) {
2727 throw ' GITHUB_RUN_ID is required for Secrets tests because secret cleanup uses run-scoped wildcard names.'
2828 }
29- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
3029}
3130
3231Describe ' Secrets' {
@@ -53,16 +52,13 @@ Describe 'Secrets' {
5352
5453 switch ($OwnerType ) {
5554 ' user' {
56- # Declarative get-or-create so partial reruns (issue #590) can rebuild
57- # the shared repository if AfterAll already tore it down.
58- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType ' user' - Name $repoName
55+ $repo = Set-GitHubRepository - Name $repoName - AddReadme - License ' mit' - Gitignore ' VisualStudio'
5956 }
6057 ' organization' {
6158 Get-GitHubSecret - Owner $Owner | Where-Object { $_.Name -like " $secretName *" } | Remove-GitHubSecret - Confirm:$false
62- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType ' organization' - Name $repoName
63- $extras = Initialize-SharedTestRepositoryExtras - Owner $Owner - BaseName $repoName
64- $repo2 = $extras [0 ]
65- $repo3 = $extras [1 ]
59+ $repo = Set-GitHubRepository - Organization $Owner - Name $repoName - AddReadme - License ' mit' - Gitignore ' VisualStudio'
60+ $repo2 = Set-GitHubRepository - Organization $Owner - Name " $repoName -2"
61+ $repo3 = Set-GitHubRepository - Organization $Owner - Name " $repoName -3"
6662 LogGroup " Org secret - [$orgSecretName ]" {
6763 $params = @ {
6864 Owner = $owner
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ BeforeAll {
2626 if (-not $id ) {
2727 throw ' GITHUB_RUN_ID is not set. Variables tests refuse to run without a scoped run ID to avoid deleting variables from other runs.'
2828 }
29- . " $PSScriptRoot /Data/SharedTestRepositories.ps1"
3029}
3130
3231Describe ' Variables' {
@@ -53,16 +52,13 @@ Describe 'Variables' {
5352
5453 switch ($OwnerType ) {
5554 ' user' {
56- # Declarative get-or-create so partial reruns (issue #590) can rebuild
57- # the shared repository if AfterAll already tore it down.
58- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType ' user' - Name $repoName
55+ $repo = Set-GitHubRepository - Name $repoName - AddReadme - License ' mit' - Gitignore ' VisualStudio'
5956 }
6057 ' organization' {
6158 Get-GitHubVariable - Owner $Owner | Where-Object { $_.Name -like " $variableName *" } | Remove-GitHubVariable - Confirm:$false
62- $repo = Initialize-SharedTestRepository - Owner $Owner - OwnerType ' organization' - Name $repoName
63- $extras = Initialize-SharedTestRepositoryExtras - Owner $Owner - BaseName $repoName
64- $repo2 = $extras [0 ]
65- $repo3 = $extras [1 ]
59+ $repo = Set-GitHubRepository - Organization $Owner - Name $repoName - AddReadme - License ' mit' - Gitignore ' VisualStudio'
60+ $repo2 = Set-GitHubRepository - Organization $Owner - Name " $repoName -2"
61+ $repo3 = Set-GitHubRepository - Organization $Owner - Name " $repoName -3"
6662 LogGroup " Org variable - [$orgVariableName ]" {
6763 $params = @ {
6864 Owner = $owner
You can’t perform that action at this time.
0 commit comments