This repository has been archived by the owner on Mar 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
76 lines (62 loc) · 3.55 KB
/
appveyor.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: 1.0.{build}
build: off
environment:
PGUSER: "postgres"
PGPASSWORD: "Password12!"
PGPORT: 5432
PGHOST: "localhost"
DBNAME: rdl_integration_test_target_db
MSSQLSTR: "{'username': '','password': '','server_string': '(local)\\SQL2016'}"
matrix:
- PYTHON: "C:\\Python37-x64" #This needs to be a double slash
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"
services:
- postgresql101
- mssql2016
init:
- set PATH=C:\program Files\PostgreSQL\10\bin\;%PATH%
- ps: Set-Content "c:\program files\postgresql\10\data\pg_hba.conf" "host all all ::1/128 trust"
- ps: Add-Content "c:\program files\postgresql\10\data\pg_hba.conf" "host all all 127.0.0.1/32 trust"
#Enable this line to enable RDP for the build.
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
#Setup Python
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% #Swap path to python to latest version (as per matrix above)
- python --version
#Create Virtual Environment
- python -m venv c:\projects\relational-data-loader\venv\
build_script:
#Setup the source MSSQL database
- sqlcmd -b -E -S "(local)\SQL2016" -i .\tests\integration_tests\mssql_source\source_database_setup\create_database.sql
- sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RDL_Integration_Test_Source_Db -i .\tests\integration_tests\mssql_source\source_database_setup\create_large_table.sql
- sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RDL_Integration_Test_Source_Db -i .\tests\integration_tests\mssql_source\source_database_setup\create_compound_pk.sql
#Setup the target PostgreSQL database
- psql -c "SELECT VERSION()"
- createdb %DBNAME%
- psql -d %DBNAME% -U postgres -a -v ON_ERROR_STOP=1 -f .\tests\integration_tests\psql_destination\setup-db.sql
#Activate Virtual Environment
- C:\projects\relational-data-loader\venv\Scripts\activate.bat
#Install the dependencies for rdl.
- pip install .
- alembic -c rdl/alembic.ini -x postgresql+psycopg2://rdl_integration_test_user:rdl_integration_test_password@localhost/rdl_integration_test_target_db upgrade head
test_script:
# unit tests
- .\tests\unit_tests\run_unit_tests.cmd
# integration tests
- .\tests\integration_tests\test_full_refresh_from_mssql.cmd
- .\tests\integration_tests\test_incremental_refresh_from_mssql.cmd
- .\tests\integration_tests\test_audit.cmd
- .\tests\integration_tests\test_full_refresh_from_mssql.cmd
- .\tests\integration_tests\test_incremental_refresh_from_mssql.cmd
- sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RDL_Integration_Test_Source_Db -i .\tests\integration_tests\mssql_source\source_database_setup\change_compound_pk.sql
- .\tests\integration_tests\test_incremental_refresh_from_mssql.cmd
- sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RDL_Integration_Test_Source_Db -i .\tests\integration_tests\mssql_source\source_database_setup\change_large_table.sql
- .\tests\integration_tests\test_full_refresh_from_mssql.cmd
- .\tests\integration_tests\test_audit.cmd
- .\tests\integration_tests\test_pi_leak.cmd
- .\tests\integration_tests\test_mssql_failover_server.cmd
on_finish:
#Enable this line to make the build pause after completion for RDP troubleshooting.
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- alembic -c rdl/alembic.ini -x postgresql+psycopg2://rdl_integration_test_user:rdl_integration_test_password@localhost/rdl_integration_test_target_db downgrade base