File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Regression test: compare tv_downloader_fixed and tv_downloader_enhanced outputs for a URL
2+ # Usage: . .venv\Scripts\Activate.ps1; ./scripts/regression_test.ps1 -Url "https://www.tradingview.com/scripts/luxalgo/"
3+ param (
4+ [string ]$Url = " https://www.tradingview.com/scripts/luxalgo/" ,
5+ [int ]$MaxPages = 3
6+ )
7+
8+ $env: PINE_OUTPUT_DIR = " "
9+ $base = Get-Location
10+ Remove-Item - Recurse - Force - ErrorAction SilentlyContinue " test_fixed" | Out-Null
11+ Remove-Item - Recurse - Force - ErrorAction SilentlyContinue " test_enhanced" | Out-Null
12+
13+ Write-Host " Running fixed downloader..." - ForegroundColor Cyan
14+ python tv_downloader_fixed.py -- url $Url -- output ./ test_fixed -- max- pages $MaxPages -- visible:$false
15+
16+ Write-Host " Running enhanced downloader..." - ForegroundColor Cyan
17+ python tv_downloader_enhanced.py -- url $Url -- output ./ test_enhanced -- no- resume -- delay 1.5 -- visible:$false
18+
19+ function Count-PineFiles ($dir ) {
20+ if (! (Test-Path $dir )) { return 0 }
21+ return (Get-ChildItem - Recurse - Include * .pine - Path $dir - ErrorAction SilentlyContinue | Measure-Object ).Count
22+ }
23+
24+ $fixedCount = Count- PineFiles " $base \test_fixed"
25+ $enhancedCount = Count- PineFiles " $base \test_enhanced"
26+
27+ Write-Host " \nResults:" - ForegroundColor Green
28+ Write-Host " Fixed downloader: $fixedCount .pine files" - ForegroundColor Yellow
29+ Write-Host " Enhanced downloader: $enhancedCount .pine files" - ForegroundColor Yellow
30+
31+ if ($fixedCount -ne $enhancedCount ) {
32+ Write-Host " Counts differ. Inspect ./test_fixed and ./test_enhanced for details." - ForegroundColor Red
33+ } else {
34+ Write-Host " Counts match." - ForegroundColor Green
35+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Wants=network-online.target
77Type =oneshot
88WorkingDirectory =/home/serveradmin/Tradingview-Pine-Script-Downloader
99Environment =PINE_OUTPUT_DIR =/mnt/pinescripts
10- Environment =DOWNLOAD_URL =" https://www.tradingview.com/scripts/luxalgo/ "
10+ Environment =DOWNLOAD_URL =" https://www.tradingview.com/scripts/?script_type=libraries "
1111ExecStart =/home/serveradmin/Tradingview-Pine-Script-Downloader/scripts/run_download.sh --url ${DOWNLOAD_URL}
1212User =serveradmin
1313Nice =10
You can’t perform that action at this time.
0 commit comments