-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_tests.ps1
50 lines (45 loc) · 1.57 KB
/
run_tests.ps1
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
Param([switch] $noDeps)
$ErrorActionPreference = "Stop"
Push-Location
cd .\integration_tests
try {
if ($noDeps) {
Write-Host "Skipping dbt deps" -ForegroundColor DarkGray
} else {
Write-Warning "Running 'dbt deps' as administrator. Remove this when dbt issue with local dependencies is resolved: https://github.com/fishtown-analytics/dbt/issues/766"
Write-Host "dbt deps" -ForegroundColor Cyan
$process = Start-Process powershell -ArgumentList "
Write-Host ""dbt deps"" -ForegroundColor Cyan;
cd $((Get-Item -Path ".\").FullName);
dbt deps;
Exit `$LASTEXITCODE;" -Verb "runAs" -Wait -PassThru
$process.WaitForExit()
if ($process.ExitCode -gt 0) {
throw "'dbt deps' returned exit code $($process.ExitCode)"
}
}
Write-Host "dbt seed --full-refresh" -ForegroundColor Cyan
dbt seed --full-refresh
if ($LASTEXITCODE -gt 0) {
throw "'dbt seed' returned exit code $LASTEXITCODE"
}
Write-Host "dbt run --full-refresh" -ForegroundColor Cyan
dbt run --full-refresh
if ($LASTEXITCODE -gt 0) {
throw "'dbt run' returned exit code $LASTEXITCODE"
}
# run again for incrementals
Write-Host "dbt run" -ForegroundColor Cyan
dbt run --full-refresh
if ($LASTEXITCODE -gt 0) {
throw "'dbt run' returned exit code $LASTEXITCODE"
}
Write-Host "dbt test" -ForegroundColor Cyan
dbt test
if ($LASTEXITCODE -gt 0) {
throw "'dbt test' returned exit code $LASTEXITCODE"
}
}
finally {
Pop-Location
}