Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test folder structure #4182

Closed
Tracked by #4057
eriqua opened this issue Nov 3, 2023 · 1 comment · Fixed by #4181
Closed
Tracked by #4057

Update test folder structure #4182

eriqua opened this issue Nov 3, 2023 · 1 comment · Fixed by #4181
Assignees

Comments

@eriqua
Copy link
Contributor

eriqua commented Nov 3, 2023

  • Rename folder into e2e
  • Move folder into a new tests folder
  • Update Initialize-Pipeline to support new test folder name
  • Update Pester tests to support new test folder name
  • Update reference to main.bicep in main.test.bicep
  • Update reference to .shared/.scripts
  • Update reference to .shared/.templates
@eriqua
Copy link
Contributor Author

eriqua commented Nov 4, 2023

Run from modules

$oldTestPaths=(Get-ChildItem -Filter '.test' -Directory -Recurse).FullName
   
foreach ($testPath in $oldTestPaths){
	$e2eDestination = Join-Path $testPath "e2e"
	$childTestFolders = Get-ChildItem $testPath -Exclude *e2e
	if (-not (Test-Path -Path $e2eDestination)) {
		New-Item -Path $testPath -Name "e2e" -ItemType Directory
	}
	if (-not ([string]::IsNullOrEmpty($childTestFolders.FullName))) {
		$childTestFolders.FullName | Move-Item -Destination $e2eDestination
	}
}

foreach ($testPath in $oldTestPaths){
	$newName = $testPath -replace '.test','tests'
	Rename-Item -Path $testPath -NewName $newName  
}

Search&Replace

  '../../../../.shared/.scripts -> '../../../../../.shared/.scripts
  module testDeployment '../../main.bicep -> module testDeployment '../../../main.bicep
  '../../../../.shared/.templates -> '../../../../../.shared/.templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant