Update run_tests.ps1 to run all tests across subdirectories

- Modified the script to navigate to the `tests` directory and run all tests in all subdirectories.
This commit is contained in:
2024-08-20 17:53:26 -05:00
parent 532672eee1
commit 942e301326
+4 -4
View File
@@ -5,7 +5,7 @@ if (Test-Path $requirementsFile) {
Write-Output "Checking for dependencies in $requirementsFile ..." Write-Output "Checking for dependencies in $requirementsFile ..."
$dependencies = Get-Content $requirementsFile $dependencies = Get-Content $requirementsFile
foreach ($dependency in $dependencies) { foreach ($dependency in $dependencies) {
$packageName = $dependency -split "==")[0] $packageName = ($dependency -split "==")[0]
if (-not (pip show $packageName)) { if (-not (pip show $packageName)) {
Write-Output "Installing missing dependency: $packageName ..." Write-Output "Installing missing dependency: $packageName ..."
pip install $dependency pip install $dependency
@@ -19,11 +19,11 @@ if (Test-Path $requirementsFile) {
} }
# Navigate to the tests directory and run tests # Navigate to the tests directory and run tests
$testsDirectory = "tests/claude" $testsDirectory = "tests"
if (Test-Path $testsDirectory) { if (Test-Path $testsDirectory) {
Write-Output "Running tests in $testsDirectory ..." Write-Output "Running tests in $testsDirectory and all subdirectories ..."
Push-Location $testsDirectory Push-Location $testsDirectory
python -m unittest discover python -m unittest discover -s . -p "*.py"
Pop-Location Pop-Location
} else { } else {
Write-Output "Tests directory $testsDirectory not found." Write-Output "Tests directory $testsDirectory not found."