Skip to content

Commit 46b9baa

Browse files
authored
Merge pull request #109 from peetw/feature/appveyor-linux-ci
2 parents 0d52834 + 83cf5df commit 46b9baa

File tree

4 files changed

+69
-59
lines changed

4 files changed

+69
-59
lines changed

Tests.NHibernate.Spatial.MsSql2008/MsSql2008NtsTestCasesFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected override void Configure(Configuration configuration)
1717
TestConfiguration.Configure(configuration);
1818
}
1919

20-
private const string LocalDataPath = @"..\..\..\..\Tests.NHibernate.Spatial.MsSql2008\NtsTestCases\Data\vivid";
20+
private const string LocalDataPath = @"../../../../Tests.NHibernate.Spatial.MsSql2008/NtsTestCases/Data/vivid";
2121

2222
protected override string TestSimpleDataPath
2323
{

Tests.NHibernate.Spatial.MsSql2012/MsSql2012NtsTestCasesFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protected override void Configure(Configuration configuration)
1212
TestConfiguration.Configure(configuration);
1313
}
1414

15-
private const string LocalDataPath = @"..\..\..\..\Tests.NHibernate.Spatial.MsSql2012\NtsTestCases\Data\vivid";
15+
private const string LocalDataPath = @"../../../../Tests.NHibernate.Spatial.MsSql2012/NtsTestCases/Data/vivid";
1616

1717
protected override string TestRelateAADataPath
1818
{

Tests.NHibernate.Spatial/NtsTestCases/NtsTestCasesFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Tests.NHibernate.Spatial.NtsTestCases
1717
/// </summary>
1818
public abstract class NtsTestCasesFixture : AbstractFixture
1919
{
20-
private const string DataPath = @"..\..\..\..\Tests.NHibernate.Spatial\NtsTestCases\Data\vivid";
20+
private const string DataPath = @"../../../../Tests.NHibernate.Spatial/NtsTestCases/Data/vivid";
2121

2222
protected override Type[] Mappings
2323
{

appveyor.yml

Lines changed: 66 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,65 @@
33
#---------------------------------#
44

55
# Build worker image (VM template)
6-
image: Visual Studio 2017
6+
image:
7+
- Visual Studio 2017
8+
- Ubuntu
79

810
# scripts that run after cloning repository
911
install:
1012
# install SQL Server 2008 R2 SP2 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
11-
- curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
12-
- SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2008R2SP2 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
13+
- cmd: curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
14+
- cmd: SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2008R2SP2 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
1315

1416
# install SQL Server 2012 SP1 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
15-
- curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
16-
- SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2012SP1 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
17+
- cmd: curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
18+
- cmd: SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2012SP1 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
1719

1820
# install x86 CLR types for SQL Server 2012 SP1 (required when running dotnet test for MsSql tests)
19-
- curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
20-
- SQLSysClrTypes.msi /passive
21+
- cmd: curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
22+
- cmd: SQLSysClrTypes.msi /passive
2123

2224
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
23-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
24-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
25-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
26-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
25+
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
26+
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
27+
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
28+
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
2729

2830
# install MySQL 5.6
29-
# - curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
30-
# - msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
31-
# - cmd /c ""C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent"
31+
# - cmd: curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
32+
# - cmd: msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
33+
# - cmd: "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent
3234

3335
# change default port for MySQL 5.7 (so it can run simultaneously with MySQL 5.6)
34-
# - ps: $iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini'
35-
# - ps: (Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath
36+
# - ps: if ($isWindows) { $iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini' }
37+
# - ps: if ($isWindows) { (Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath }
3638

3739
# install PostgreSQL 8.4
38-
- curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
39-
- postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
40+
- cmd: curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
41+
- cmd: postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
4042

4143
# install PostGIS 1.5.5 for PostgreSQL 8.4
42-
- curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
43-
- 7z x postgis-pg84-binaries-1.5.5.zip > nul
44-
- xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
45-
- SET PGPASSWORD=Password12!
46-
- SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
47-
- cmd /c ""%PGDIR%\bin\createdb" -p 5431 -U postgres template_postgis"
48-
- cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql""
49-
- cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql""
44+
- cmd: curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
45+
- cmd: 7z x postgis-pg84-binaries-1.5.5.zip > nul
46+
- cmd: xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
47+
- cmd: SET PGPASSWORD=Password12!
48+
- cmd: SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
49+
- cmd: SET PATH=%PGDIR%\bin;%PATH%
50+
- cmd: createdb -p 5431 -U postgres template_postgis
51+
- cmd: psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql"
52+
- cmd: psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql"
5053

51-
# install PostGIS 2.3.2 for PostgreSQL 9.6
52-
- curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
53-
- 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
54-
- xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
54+
# install PostGIS 2.3.2 for PostgreSQL 9.6 on Windows
55+
- cmd: curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
56+
- cmd: 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
57+
- cmd: xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
5558

56-
# start services required for build/tests
57-
services:
58-
# - mysql56 # start MySQL 5.6
59-
# - mysql57 # start MySQL 5.7
60-
- postgresql96 # start PostgreSQL 9.6
59+
# install PostgreSQL 9.6 and PostGIS 2.3 on Ubuntu
60+
- sh: sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
61+
- sh: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
62+
- sh: sudo apt-get update
63+
- sh: sudo apt-get -y install postgresql-9.6 postgresql-9.6-postgis-2.3
64+
- sh: sudo sed -i 's/port = [0-9]\+/port = 5432/' /etc/postgresql/9.6/main/postgresql.conf
6165

6266
#---------------------------------#
6367
# build configuration #
@@ -74,8 +78,8 @@ build:
7478

7579
# scripts to run before build
7680
before_build:
77-
- cmd: dotnet --version
78-
- cmd: dotnet restore --verbosity minimal
81+
- dotnet --version
82+
- dotnet restore --verbosity minimal
7983

8084
#---------------------------------#
8185
# tests configuration #
@@ -84,27 +88,35 @@ before_build:
8488
# scripts to run before tests
8589
before_test:
8690
# setup SQL Server 2008
87-
- sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
91+
- cmd: sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
8892

8993
# setup SQL Server 2012
90-
- sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
94+
- cmd: sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
9195

9296
# setup MySQL 5.6
93-
# - SET MYSQL_PWD=Password12!
94-
# - SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
95-
# - cmd /c "%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql"
97+
# - cmd: net start mysql56
98+
# - cmd: SET MYSQL_PWD=Password12!
99+
# - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
100+
# - cmd: '%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql'
96101

97102
# setup MySQL 5.7
98-
# - SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
99-
# - cmd /c "%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql"
103+
# - cmd: net start mysql57
104+
# - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
105+
# - cmd: '%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql'
100106

101107
# setup PostgreSQL 8.4
102-
- SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
103-
- cmd /c "%psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql"
108+
- cmd: SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
109+
- cmd: '%psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql'
104110

105-
# setup PostgreSQL 9.6
106-
- SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
107-
- cmd /c "%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql"
111+
# setup PostgreSQL 9.6 on Windows
112+
- cmd: net start postgresql-x64-9.6
113+
- cmd: SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
114+
- cmd: '%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql'
115+
116+
# setup PostgreSQL 9.6 on Ubuntu
117+
# NOTE: Need to run psql command as postgres user to prevent peer authentication failure
118+
- sh: sudo pg_ctlcluster 9.6 main start
119+
- sh: sudo -u postgres psql -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20/nhsp_test.sql
108120

109121
test_script:
110122
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2008.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2008
@@ -113,16 +125,14 @@ test_script:
113125
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL
114126
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL57.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL57
115127
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis
116-
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis20
128+
- ps: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory $env:APPVEYOR_BUILD_FOLDER Tests.NHibernate.Spatial.PostGis20
117129

118130
after_test:
119-
# NOTE: Temporary fix for test log file names - remove once new dotnet SDK version installed on AppVeyor; see:
120-
# https://github.com/Microsoft/vstest/issues/1951
121131
- ps: $wc = New-Object 'System.Net.WebClient'
122132
- ps: $uri = "https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)"
123-
- ps: $wc.UploadFile($uri, (Resolve-Path MsSql2008_*.trx))
124-
- ps: $wc.UploadFile($uri, (Resolve-Path MsSql2012_*.trx))
133+
- ps: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path MsSql2008.trx)) }
134+
- ps: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path MsSql2012.trx)) }
125135
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL.trx))
126136
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL57.trx))
127-
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis_*.trx))
128-
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis20_*.trx))
137+
- ps: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path PostGis.trx)) }
138+
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis20.trx))

0 commit comments

Comments
 (0)