Skip to content

Commit 2f72aed

Browse files
committed
Better tests configuration.
1 parent b75a8ed commit 2f72aed

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

Provider/tests.ps1

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
param(
22
[Parameter(Mandatory=$True)]$Configuration,
3-
[Parameter(Mandatory=$True)]$FbDownload,
4-
[Parameter(Mandatory=$True)]$FbStart)
3+
[Parameter(Mandatory=$True)]$FirebirdSelection)
54

65
$ErrorActionPreference = 'Stop'
76

7+
$FirebirdConfiguration = @{
8+
FB30_Default = @{
9+
Download = 'https://www.dropbox.com/s/x46uy7e5zrtsnux/fb30.7z?dl=1';
10+
Start = '.\firebird.exe -a';
11+
};
12+
FB25_SC = @{
13+
Download = 'https://www.dropbox.com/s/ayzjnxjx20vb7s5/fb25.7z?dl=1';
14+
Start = '.\bin\fb_inet_server.exe -a -m';
15+
};
16+
}
17+
818
$baseDir = Split-Path -Parent $PSCommandPath
919
$testsBaseDir = "$baseDir\src\FirebirdSql.Data.FirebirdClient.Tests"
1020
$testsNETDir = "$testsBaseDir\bin\$Configuration\net452"
1121
$testsCOREDir = "$testsBaseDir\bin\$Configuration\netcoreapp2.0"
1222

23+
if ($env:tests_firebird_dir) {
24+
$firebirdDir = $env:tests_firebird_dir
25+
}
26+
else {
27+
$firebirdDir = 'I:\Downloads\fb_tests'
28+
}
29+
1330
function Check-ExitCode($command) {
1431
& $command
1532
$exitCode = $LASTEXITCODE
@@ -20,20 +37,30 @@ function Check-ExitCode($command) {
2037
}
2138

2239
function Prepare() {
23-
$fbDownloadName = $FbDownload -Replace '.+/([^/]+)\?dl=1','$1'
24-
mkdir $env:tests_firebird_dir | Out-Null
25-
cd $env:tests_firebird_dir
26-
(New-Object System.Net.WebClient).DownloadFile($FbDownload, (Join-Path (pwd) $fbDownloadName))
40+
$selectedConfiguration = $FirebirdConfiguration[$FirebirdSelection]
41+
$fbDownload = $selectedConfiguration.Download
42+
$fbStart = $selectedConfiguration.Start
43+
$fbDownloadName = $fbDownload -Replace '.+/([^/]+)\?dl=1','$1'
44+
if (Test-Path $firebirdDir) {
45+
rm -Force -Recurse $firebirdDir
46+
}
47+
mkdir $firebirdDir | Out-Null
48+
cd $firebirdDir
49+
echo "Downloading: $fbDownload"
50+
(New-Object System.Net.WebClient).DownloadFile($fbDownload, (Join-Path (pwd) $fbDownloadName))
51+
echo "Extracting: $fbDownloadName"
2752
7z x $fbDownloadName | Out-Null
2853
cp -Recurse -Force .\embedded\* $testsNETDir
2954
cp -Recurse -Force .\embedded\* $testsCOREDir
3055
rmdir -Recurse .\embedded
3156
rm $fbDownloadName
3257
mv .\server\* .
3358
rmdir .\server
34-
35-
iex $FbStart
59+
3660
ni firebird.log -ItemType File | Out-Null
61+
62+
echo "Starting: $fbStart"
63+
iex $fbStart
3764
}
3865

3966
function Tests-FirebirdClient() {

appveyor.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,8 @@ configuration:
44
- Release
55
environment:
66
matrix:
7-
- name: FB 3.0 (Default)
8-
fb_download: https://www.dropbox.com/s/x46uy7e5zrtsnux/fb30.7z?dl=1
9-
fb_start: .\firebird.exe -a
10-
11-
- name: FB 2.5 (SC)
12-
fb_download: https://www.dropbox.com/s/ayzjnxjx20vb7s5/fb25.7z?dl=1
13-
fb_start: .\bin\fb_inet_server.exe -a -m
14-
15-
# - name: FB 2.5 (CS)
16-
# fb_download: https://www.dropbox.com/s/ayzjnxjx20vb7s5/fb25.7z?dl=1
17-
# fb_start: .\bin\fb_inet_server.exe -a
7+
- firebird_selection: FB30_Default
8+
- firebird_selection: FB25_SC
189
test: off
1910
init:
2011
- git config --global core.autocrlf true
@@ -28,4 +19,4 @@ after_build:
2819
- ps: gci "$baseDir\Provider\out" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
2920
test_script:
3021
- ps: $env:tests_firebird_dir = 'C:\firebird'
31-
- ps: "& $baseDir\\Provider\\tests.ps1 -Configuration $env:CONFIGURATION -FbDownload $env:fb_download -FbStart $env:fb_start"
22+
- ps: "& $baseDir\\Provider\\tests.ps1 -Configuration $env:CONFIGURATION -FirebirdSelection $env:firebird_selection"

0 commit comments

Comments
 (0)