-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunTests.ps1
More file actions
50 lines (42 loc) · 1.37 KB
/
RunTests.ps1
File metadata and controls
50 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# pCloud Sync Test Runner (PowerShell)
# Convenience script for running tests on Windows
# Stop on errors
$ErrorActionPreference = "Stop"
Write-Host "========================================"
Write-Host "pCloud Sync Test Suite"
Write-Host "========================================"
Write-Host ""
# Check if .env exists
if (-Not (Test-Path ".env")) {
Write-Host "ERROR: .env file not found!" -ForegroundColor Red
Write-Host "Please create .env file from .env.example and configure your credentials."
Write-Host ""
Write-Host "Run: Copy-Item .env.example .env"
Write-Host "Then edit .env and add your PCLOUD_AUTH_TOKEN"
exit 1
}
# Check if virtual environment exists
if (-Not (Test-Path "venv")) {
Write-Host "Virtual environment not found. Creating one..."
python -m venv venv
Write-Host "Installing dependencies..."
& ".\venv\Scripts\Activate.ps1"
pip install -r requirements.txt
} else {
& ".\venv\Scripts\Activate.ps1"
}
Write-Host "Virtual environment activated"
Write-Host ""
# Parse command line arguments
$TestArgs = $args
if ($TestArgs.Count -eq 0) {
Write-Host "Running all tests..."
pytest -v
} else {
Write-Host "Running tests with arguments: $TestArgs"
pytest @TestArgs
}
Write-Host ""
Write-Host "========================================"
Write-Host "Tests completed!"
Write-Host "========================================"