-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
128 lines (127 loc) · 7.15 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
services:
- mssql2016
- iis
image:
- Visual Studio 2017
environment:
matrix:
- TEST_SUITE: core-kernel
TEST_INDEX: 0
- TEST_SUITE: core-kernel
TEST_INDEX: 1
- TEST_SUITE: core-extensions-kernel
TEST_INDEX: 0
- TEST_SUITE: core-extensions-kernel
TEST_INDEX: 1
- TEST_SUITE: core-extensions-kernel
TEST_INDEX: 2
- TEST_SUITE: core-extensions-kernel
TEST_INDEX: 3
- TEST_SUITE: passing_functional,unit
- TEST_SUITE: passing_functional2
install:
# Set up the Environment
- cmd: mkdir c:\testlogs
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/Beakerboy/drupal-sqlsrv-regex/releases/download/1.0/RegEx.dll', 'C:\testlogs\RegEx.dll')
# SET UP PHP
- ps: choco install php --version=7.3.12 --package-parameters="/InstallDir:C:\tools\php" -y --no-progress 2>&1 > C:\TestLogs\choco_install_php.txt
- ps: choco install urlrewrite -y --no-progress 2>&1 > C:\testlogs\choco_install_urlrewrite.txt
- ps: |
$cli = New-Object Net.WebClient
$cli.Headers['User-Agent'] = 'Appveyor';
$cli.DownloadFile('https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/5.8.1/php_pdo_sqlsrv-5.8.1-7.3-nts-vc15-x64.zip', 'C:\testlogs\php_pdo_sqlsrv.zip')
- ps: |
$cli = New-Object Net.WebClient
$cli.Headers['User-Agent'] = 'Appveyor';
$cli.DownloadFile('http://windows.php.net/downloads/pecl/releases/yaml/2.1.0/php_yaml-2.1.0-7.3-nts-vc15-x64.zip', 'C:\testlogs\php_yaml.zip')
- ps: Expand-Archive -Path 'C:\testlogs\php_pdo_sqlsrv.zip' -Destinationpath 'C:\testlogs\php_pdo_sqlsrv'
- cmd: copy C:\testlogs\php_pdo_sqlsrv\php_pdo_sqlsrv.dll C:\tools\php\ext
- ps: Expand-Archive -Path 'C:\testlogs\php_yaml.zip' -Destinationpath 'C:\testlogs\php_yaml'
- cmd: xcopy C:\testlogs\php_yaml\php_yaml.dll C:\tools\php\ext
# Start Windows Update service
- cmd: sc config wuauserv start= auto
- cmd: net start wuauserv
# Add php binary to PATH
- ps: $Env:Path = "C:\tools\php;" + $Env:Path;
# Edit the php.ini file - Should we have a php.ini.dist file somewhere that we just `cat` into the exiting file?
- ps: Add-Content C:\tools\php\php.ini "extension_dir=ext"
- ps: Add-Content C:\tools\php\php.ini "extension=php_pdo_sqlsrv"
- ps: Add-Content C:\tools\php\php.ini "extension=php_openssl"
- ps: Add-Content C:\tools\php\php.ini "extension=php_mbstring"
- ps: Add-Content C:\tools\php\php.ini "extension=php_curl"
- ps: Add-Content C:\tools\php\php.ini "extension=php_yaml"
- ps: Add-Content C:\tools\php\php.ini "extension=php_gd2.dll"
# Install Composer
- ps: new-item c:\composer -itemtype directory
- cmd: cd /d C:\composer
- cmd: choco install composer -y
- ps: refreshenv
- cmd: SET PATH=C:\ProgramData\ComposerSetup\bin;%PATH%
# Download Drupal
- cmd: cd /d C:\inetpub\
- cmd: mv wwwroot wwwroot-old
- cmd: git clone https://git.drupalcode.org/project/drupal.git -b 9.1.x wwwroot
# IIS Config
- cmd: powershell %APPVEYOR_BUILD_FOLDER%\dev\appveyor\iis.ps1
build_script:
# For some reason this cannot go in the install potion of the appveyor config
- cmd: sqlcmd -U sa -P Password12! -Q "CREATE DATABASE mydrupalsite"
- cmd: sqlcmd -d mydrupalsite -U sa -P Password12! -Q "EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'clr enable', 1; RECONFIGURE"
- cmd: sqlcmd -d mydrupalsite -U sa -P Password12! -Q "CREATE ASSEMBLY Regex from 'C:\testlogs\RegEx.dll' WITH PERMISSION_SET = SAFE"
- cmd: sqlcmd -d mydrupalsite -U sa -P Password12! -Q "CREATE FUNCTION dbo.REGEXP(@pattern NVARCHAR(100), @matchString NVARCHAR(100)) RETURNS bit EXTERNAL NAME Regex.RegExCompiled.RegExCompiledMatch"
# Set up Drupal
- cmd: cd /d C:\inetpub\wwwroot
# Apply any pre-composer patches
- ps: (New-Object Net.WebClient).DownloadFile('https://www.drupal.org/files/issues/2020-07-28/3151118-31.patch', 'C:\inetpub\wwwroot\3151118.patch')
- cmd: git apply 3151118.patch
- cmd: del 3151118.patch
- cmd: set COMPOSER_MEMORY_LIMIT=-1
- cmd: composer install -q
# Add composer installed binaries to PATH
- cmd: SET PATH=C:\inetpub\wwwroot\vendor\bin;%PATH%
# Install other composer packages for production
# Copy in the module
- cmd: xcopy /S /I /E /Y /Q %APPVEYOR_BUILD_FOLDER%\tests\database_statement_monitoring_test .\core\modules\system\tests\modules\database_statement_monitoring_test\src\sqlsrv
- cmd: xcopy /S /I /E /Y /Q %APPVEYOR_BUILD_FOLDER%\dev\TestSuites %APPVEYOR_BUILD_FOLDER%\tests\src\TestSuites
- cmd: xcopy /S /I /E /Y /Q %APPVEYOR_BUILD_FOLDER%\dev\appveyor\CITestSuiteBase.php %APPVEYOR_BUILD_FOLDER%\tests\src\TestSuites
- cmd: xcopy /S /I /E /Y /Q %APPVEYOR_BUILD_FOLDER% %cd%\modules\sqlsrv
- cmd: mkdir C:\inetpub\wwwroot\sites\simpletest
- cmd: mkdir C:\inetpub\wwwroot\sites\simpletest\browser_output
# Should we use recursive instead?
- ps: |
$sharepath = "C:\inetpub\wwwroot\sites"
$Acl = Get-ACL $SharePath
$AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","ContainerInherit,Objectinherit","none","Allow")
$Acl.AddAccessRule($AccessRule)
Set-Acl $SharePath $Acl
- ps: |
$sharepath = "C:\inetpub\wwwroot\sites\simpletest\browser_output"
$Acl = Get-ACL $SharePath
$AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","ContainerInherit,Objectinherit","none","Allow")
$Acl.AddAccessRule($AccessRule)
Set-Acl $SharePath $Acl
# Core Patches
# Testing Patches
# ConnectionUnitTest defaults to MySQL syntax
- ps: (New-Object Net.WebClient).DownloadFile('http://beakerboy.com/~kevin/connectionUnit.patch', 'C:\inetpub\wwwroot\connectionUnit.patch')
- cmd: git apply connectionUnit.patch
# Enable sqlsrv module for Kernel Tests
- ps: (New-Object Net.WebClient).DownloadFile('https://www.drupal.org/files/issues/2020-05-02/2966272-16.patch', 'C:\inetpub\wwwroot\2966272.patch')
- cmd: git apply 2966272.patch
# Enable sqlsrv in specific Functional Tests
- ps: (New-Object Net.WebClient).DownloadFile('http://beakerboy.com/~kevin/Function-timestamp.patch', 'C:\inetpub\wwwroot\Function-timestamp.patch')
- cmd: git apply Function-timestamp.patch
# Add a sqlsrv-specific data type to the core test
- ps: (New-Object Net.WebClient).DownloadFile('https://www.drupal.org/files/issues/2020-02-05/drupal-3111134-database_specific_types-3.patch', 'C:\inetpub\wwwroot\drupal-3111134-database_specific_types.patch')
- cmd: git apply drupal-3111134-database_specific_types.patch
# CharacterSet does not need to be uppercase
- ps: (New-Object Net.WebClient).DownloadFile('http://beakerboy.com/~kevin/caseInsensitiveCharset.patch', 'C:\inetpub\wwwroot\caseInsensitiveCharset.patch')
- cmd: git apply caseInsensitiveCharset.patch
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- ps: ((Get-Content -path dev\phpunit.xml.dist -Raw) -replace 'WEB_DIR/sites/simpletest/browser_output','C:\inetpub\wwwroot\sites\simpletest\browser_output') | Set-Content -Path dev\phpunit.xml.dist
before_test:
- cmd: cp dev\phpunit.xml.dist C:\inetpub\wwwroot\core\phpunit.xml
- cmd: mkdir .\build\logs
test_script:
- cmd: cd C:\inetpub\wwwroot
- cmd: vendor\bin\phpunit -c core\phpunit.xml --testsuite=%TEST_SUITE%