-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After this commit AppVeyor will run all TimescaleDB tests on windows
- Loading branch information
1 parent
73e0b4f
commit 29eb30e
Showing
2 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
version: 1.0.{build} | ||
image: Visual Studio 2017 | ||
services: | ||
- postgresql101 | ||
build_script: | ||
- ps: >- | ||
# Create directories for tablespaces | ||
New-Item -ItemType directory -Path "C:\Users\$env:UserName\Documents\tablespace1" | ||
New-Item -ItemType directory -Path "C:\Users\$env:UserName\Documents\tablespace2" | ||
New-Item -ItemType directory -Path "C:\Users\$env:UserName\Documents\log" | ||
# Permissions for the tablespace dirs will be full access to everyone | ||
$Acl1 = Get-Acl "C:\Users\$env:UserName\Documents\tablespace1" | ||
$Ar1 = New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl", "ContainerInherit,ObjectInherit", "None", "Allow") | ||
$Acl1.SetAccessRule($Ar1) | ||
Set-Acl "C:\Users\$env:UserName\Documents\tablespace1" $Acl1 | ||
$Acl2 = Get-Acl "C:\Users\$env:UserName\Documents\tablespace2" | ||
$Ar2 = New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl", "ContainerInherit,ObjectInherit", "None", "Allow") | ||
$Acl2.SetAccessRule($Ar2) | ||
Set-Acl "C:\Users\$env:UserName\Documents\tablespace2" $Acl2 | ||
$Acl3 = Get-Acl "C:\Users\$env:UserName\Documents\log" | ||
$Ar3 = New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl", "ContainerInherit,ObjectInherit", "None", "Allow") | ||
$Acl3.SetAccessRule($Ar3) | ||
Set-Acl "C:\Users\$env:UserName\Documents\tablespace2" $Acl3 | ||
# open firewall for docker | ||
New-NetFirewallRule -DisplayName "Allow postgres" -Direction Inbound -Action Allow -Protocol Any -LocalPort Any | ||
# Set user and passworkd for psql | ||
SET PGUSER=postgres | ||
SET PGPASSWORD=Password12! | ||
Write-Output "postgresql-x64-10 should start out running" | ||
Get-Service -Name "postgresql-x64-10" | ||
Write-Output "If the binary for postgres in not in 'C:\Program Files\postgresql\10' the rest of this script won't work" | ||
reg query "HKLM\System\CurrentControlSet\Services\postgresql-x64-10" /v "ImagePath" | ||
Stop-Service postgresql-x64-10 | ||
# postgresql-x64-10 should stop | ||
Get-Service -Name "postgresql-x64-10" | ||
# we preload timescale, and allow all netowrk connections to postgres | ||
Add-Content "C:\Program Files\postgresql\10\data\postgresql.conf" "shared_preload_libraries = 'timescaledb'" | ||
Add-Content "C:\Program Files\postgresql\10\data\postgresql.conf" "log_directory = 'pg_log'" | ||
Add-Content "C:\Program Files\postgresql\10\data\postgresql.conf" "max_worker_processes=16" | ||
# TODO removing the following line causes a stack overflow on appveyor | ||
Add-Content "C:\Program Files\postgresql\10\data\postgresql.conf" "timescaledb.telemetry_level='off'" | ||
# Add-Content "C:\Program Files\postgresql\10\data\postgresql.conf" "log_min_messages='debug5'" | ||
Set-Content "C:\Program Files\postgresql\10\data\pg_hba.conf" "host all all ::1/128 trust" | ||
Add-Content "C:\Program Files\postgresql\10\data\pg_hba.conf" "host all all 127.0.0.1/32 trust" | ||
# build timescale | ||
.\bootstrap -DPG_PATH="C:\Program Files\PostgreSQL\10" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CONFIGURATION_TYPES=Debug -DCMAKE_C_FLAGS=/MP | ||
cmake --build ./build --config Debug | ||
cmake --build ./build --config Debug --target install | ||
# postgres should restart | ||
Start-Service postgresql-x64-10 | ||
Get-Service -Name "postgresql-x64-10" | ||
# create pg user root b/c docker will need it | ||
& "C:\Program Files\PostgreSQL\10\bin\psql.exe" -a -e -E -v "VERBOSITY=verbose" -c 'CREATE USER root WITH SUPERUSER IN ROLE postgres;' -U postgres | ||
& "C:\Program Files\PostgreSQL\10\bin\psql.exe" -a -e -E -v "VERBOSITY=verbose" -c 'CREATE USER super_user WITH SUPERUSER IN ROLE postgres;' -U postgres | ||
& "C:\Program Files\PostgreSQL\10\bin\psql.exe" -a -e -E -v "VERBOSITY=verbose" -c 'show log_directory' -U postgres | ||
& "C:\Program Files\PostgreSQL\10\bin\psql.exe" -a -e -E -v "VERBOSITY=verbose" -c 'show log_destination;' -U postgres | ||
& "C:\Program Files\PostgreSQL\10\bin\psql.exe" -a -e -E -v "VERBOSITY=verbose" -c 'show logging_collector;' -U postgres | ||
docker-switch-linux | ||
# docker run -d --name pgregress -v c:/projects/timescaledb:/timescale timescaledev/postgresdev:exec_backend-10-alpine | ||
docker run -d --name pgregress timescaledev/postgresdev:exec_backend-10-alpine | ||
docker exec -it pgregress /bin/bash -c "apk add cmake git diffutils" | ||
# we clone the current commit in the docker instance to ensure the correct tests run | ||
# (Ideally we'd use the same folder, but that's difficult to set up) | ||
$commit = git rev-parse HEAD | ||
docker exec -it pgregress /bin/bash -c "git clone --depth 1 https://github.com/timescale/timescaledb.git /timescaledb && cd /timescaledb && git fetch -q origin $commit && git checkout -qf FETCH_HEAD" | ||
docker exec -it pgregress /bin/bash -c "cd /timescaledb && ./bootstrap -DCMAKE_BUILD_TYPE=Debug -DPG_REGRESS=/usr/local/bin/pg_regress -DTEST_PGHOST=docker.for.win.localhost" | ||
test_script: | ||
- ps: >- | ||
Set-PSDebug -Trace 1 | ||
Get-Service -Name "postgresql-x64-10" | ||
docker exec -it pgregress /bin/bash -c "psql -a -e -E -U postgres --host='docker.for.win.localhost' -v VERBOSITY=verbose -c'\dx;'" | ||
#right now we only run timescale regression tests, others will be set up later | ||
docker exec -e TEST_TABLESPACE1_PATH="C:\Users\$env:UserName\Documents\tablespace1\" -e TEST_TABLESPACE2_PATH="C:\Users\$env:UserName\Documents\tablespace2\" -e TEST_SPINWAIT_ITERS=10000 -e USER=postgres -it pgregress /bin/bash -c "cd /timescaledb/build && make regresschecklocal" | ||
#TESTS=drop_extension | ||
on_failure: | ||
- ps: >- | ||
docker exec -it pgregress cat /timescaledb/build/test/regression.diffs /timescaledb/build/test/pgtest/regressions.diffs | ||
Get-Content -Path "C:\Program Files\postgresql\10\data\pg_log\*" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters