You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

64 regels
1.3 KiB

  1. param(
  2. [switch]$ApiOnly,
  3. [switch]$UiOnly,
  4. [switch]$All
  5. )
  6. Set-StrictMode -Version Latest
  7. $ErrorActionPreference = 'Stop'
  8. $selectedModes = @(@($ApiOnly, $UiOnly, $All) | Where-Object { $_ })
  9. if ($selectedModes.Count -gt 1) {
  10. throw 'Cannot combine -ApiOnly, -UiOnly, and -All.'
  11. }
  12. if (-not $ApiOnly -and -not $UiOnly -and -not $All) {
  13. $ApiOnly = $true
  14. }
  15. $repoRoot = Split-Path -Parent $PSScriptRoot
  16. $artifactRoot = Join-Path $repoRoot 'test-artifacts/user-migration-e2e'
  17. $runsDir = Join-Path $artifactRoot 'runs'
  18. if ($ApiOnly -or $All) {
  19. if (Test-Path $runsDir) {
  20. Remove-Item -Recurse -Force $runsDir
  21. }
  22. }
  23. Push-Location $repoRoot
  24. try {
  25. if ($ApiOnly -or $All) {
  26. Write-Host '[user-migration-e2e] running API E2E...'
  27. go test -v ./test/e2e -count=1
  28. }
  29. if ($All) {
  30. Write-Host '[user-migration-e2e] running full Go test suite...'
  31. go test ./...
  32. Write-Host '[user-migration-e2e] building frontend...'
  33. Push-Location (Join-Path $repoRoot 'web')
  34. try {
  35. bun run build
  36. }
  37. finally {
  38. Pop-Location
  39. }
  40. }
  41. if ($UiOnly -or $All) {
  42. Write-Host '[user-migration-e2e] running Playwright UI E2E...'
  43. Push-Location (Join-Path $repoRoot 'web')
  44. try {
  45. bunx playwright test
  46. }
  47. finally {
  48. Pop-Location
  49. }
  50. }
  51. }
  52. finally {
  53. Pop-Location
  54. }