View source
- skip_tags: true
- init:
- - ps: ''
- services:
- - mssql2017
- - iis
- hosts:
- www.mydrupalsite.com: 127.0.0.1
- image:
- - Visual Studio 2019
- install:
- - ps: $Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED".TrimEnd();
- - ps: $Env:TestLogDir = "$Env:BuildDir\TestLogs";
- - ps: $Env:TestLogDirClone = "$Env:BuildDir\TestLogsClone";
- - cmd: mkdir %TestLogDir%
- - cmd: mkdir %TestLogDirClone%
- - ps: Start-Transcript -path "$Env:BuildDir\console.txt" -append
- - ps: $Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED".TrimEnd();
- - ps: Start-Service 'MSSQL$SQL2017' | out-null
- - ps: Set-Service 'SQLAgent$SQL2017' -StartupType Manual | out-null
- - ps: Start-Service W3SVC | out-null
- - ps: choco install php -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_php.txt"
- - ps: choco install urlrewrite -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_urlrewrite.txt"
- - ps: choco install OpenSSL.Light -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_openssl.txt"
- - ps: choco install sqlserver-odbcdriver -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_sqlserver-odbcdriver.txt"
- - ps: Install-Module PsIni
- - ps: |
- $WorkingDir = Convert-Path .
- $ZipPath = Join-Path $WorkingDir '\chef_cmdlet.zip'
- (New-Object Net.WebClient).DownloadFile('https://ci.appveyor.com/api/projects/David19767/iischef/artifacts/iischef.cmdlet.zip?branch=1.x', $ZipPath)
- $DESTINATION= Join-Path $env:ProgramFiles "\WindowsPowerShell\Modules\Chef"
- New-Item -ItemType directory -Force -Path $DESTINATION
- (new-object -com shell.application).namespace($DESTINATION).CopyHere((new-object -com shell.application).namespace($ZipPath).Items(),16)
- Remove-Item $ZipPath
- - ps: $Env:Path = "C:\Program Files\OpenSSL;" + $Env:Path;
- - cmd: sc config wuauserv start= auto
- - cmd: net start wuauserv
- - ps: (New-Object Net.WebClient).DownloadFile('http://curl.haxx.se/ca/cacert.pem', 'C:\tools\php74\cacert.pem')
- - ps: new-item c:\composer -itemtype directory
- - ps: $Env:Path = "C:\tools\php74;" + $Env:Path;
- - ps: $Env:Path = "C:\tools\php74;" + $Env:Path;
- - ps: Add-Content C:\tools\php74\php.ini "extension_dir=ext `n"
- - ps: Add-Content C:\tools\php74\php.ini "extension=php_openssl.dll `n"
- - ps: Add-Content C:\tools\php74\php.ini "extension=php_mbstring.dll `n"
- - ps: Add-Content C:\tools\php74\php.ini "extension=php_curl.dll `n"
- - ps: Add-Content C:\tools\php74\php.ini "extension=php_gd2.dll `n"
- - ps: Add-Content C:\tools\php74\php.ini "curl.cainfo=C:\tools\php74\cacert.pem `n"
- - ps: Add-Content C:\tools\php74\php.ini "openssl.cafile=C:\tools\php74\cacert.pem `n"
- - ps: Add-Content C:\tools\php74\php.ini "memory_limit=2048M `n"
- - ps: php -i | Out-File "$Env:TestLogDir\php-i.txt"
- - cmd: cd /d C:\composer
- # RDPFINISH
- - ps: |
- If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpcomposer') {
- $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- }
- - cmd: choco install composer -y --no-progress
- - ps: Add-Content C:\ProgramData\ComposerSetup\bin\composer.bat ""
- - ps: refreshenv
- - cmd: SET PATH=C:\ProgramData\ComposerSetup\bin;%PATH%
- - ps: |
- If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpcomposer') {
- $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- }
- - cmd: composer global require hirak/prestissimo
- - cmd: cd /d c:\projects
- - cmd: IF NOT EXIST C:\projects\drupal-project composer create-project -n drupal-composer/drupal-project:8.x-dev
- - cmd: cd /d C:\projects\drupal-project
- - cmd: composer config repositories.drupal composer https://packages.drupal.org/8
- - cmd: composer require drupal/sqlsrv:dev-2.x@dev
- # Replace the pulled module with the local files, only for this CI
- - cmd: xcopy /S /I /E /Y %APPVEYOR_BUILD_FOLDER% %cd%\web\modules\contrib\sqlsrv
- # Move the PHP_BIN needed to build the PHP environment
- - cmd: xcopy /S /I /E /Y %APPVEYOR_BUILD_FOLDER%\phpbin %cd%\phpbin
- # Copy driver
- - cmd: xcopy /S /I /E /Y %cd%\web\modules\contrib\sqlsrv\drivers %cd%\web\drivers
- - ps: |
- $cwd = (Get-Location).Path;
- "php $cwd\vendor\drupal\console\bin\drupal " + $([char]37) + "*" | Out-File $cwd/web/drupal.bat -Encoding ASCII
- - cmd: cd /d C:\projects\drupal-project\web
- - cmd: xcopy "%APPVEYOR_BUILD_FOLDER%\chef" "C:\projects\drupal-project\chef" /r /s /i
- - ps: Invoke-ChefSelfInstall -Path "c:\chef"
- - ps: Invoke-ChefAppDeployPath "C:\projects\drupal-project" drupal -Install
- - ps: $site = Invoke-ChefAppGetDeployment drupal
- - ps: $Env:DATABASENAME = $site.DeploymentActive.GetRuntimeSetting("services.default.database", "");
- - ps: $Env:DATABASEPASSWORD = $site.DeploymentActive.GetRuntimeSetting("services.default.password", "");
- - ps: $Env:DATABASEUSER = $site.DeploymentActive.GetRuntimeSetting("services.default.username", "");
- - ps: $Env:DATABASEHOST = $site.DeploymentActive.GetRuntimeSetting("services.default.host", "");
- - ps: $Env:SITERUNTIMEPATH = $site.DeploymentActive.runtimePath;
- # Make the site's PHP environment the default PHP environment
- - cmd: set path=%SITERUNTIMEPATH%\php;%path%
- - cmd: drupal about
- - ps: |
- If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpinstall') {
- $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- }
- - cmd: drupal site:install standard --langcode="en" --db-type="sqlsrv" --db-host="localhost\SQL2017" --db-name="mydrupalsite" --db-user="sa" --db-pass="Password12!" --db-port="1433" --site-name="SQL Server Drupal Site" --site-mail="admin@example.com" --account-name="admin" --account-mail="admin@example.com" --account-pass="admin" --no-interaction
- - cmd: cd /d C:\projects\drupal-project
- - ps: $Env:CWD = (Get-Location).path;
- # - ps: (New-Object Net.WebClient).DownloadFile('https://www.drupal.org/files/issues/use_the_php_binary-2748883-15.patch',"$Env:CWD\patch.patch")
- # - cmd: git apply patch.patch --directory=web
- - cmd: cd /d C:\projects\drupal-project\web
- - cmd: drupal module:install simpletest
- - cmd: drupal module:install sqlsrv
- - ps: wget "http://sqlsrv.drupal.org/"
- build_script:
- - cmd: echo "No build"
- test_script:
- - cmd: cd /d C:\projects\drupal-project
- - cmd: mkdir %TestLogDir%\testresults\
- - cmd: echo Tests not run because they need to be updated as they are using deprecated implementations
- - ps: |
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\OrderByTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) OrderByTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\SqlsrvConditionTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SqlsrvConditionTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\SqlsrvConnectionTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SqlsrvConnectionTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SchemaTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SchemaTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SchemaTestExtended 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SchemaTestExtended test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ConnectionTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) ConnectionTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SelectTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SelectTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\AliasTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) AliasTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ConditionTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) ConditionTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\DeleteTruncateTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) DeleteTruncateTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\MergeTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) MergeTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ParameterTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) ParameterTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SqlsrvTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) SqlsrvTest test failed."
- }
- php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\UpdateTest 2>&1 > "$Env:TestLogDir\tests.log"
- if ($LASTEXITCODE -ne 0) {
- echo "($LASTEXITCODE) UpdateTest test failed."
- }
- # After tests, try istalling all core modules\contrib\sqlsrv - cmd: drupal module:install simpletest
- on_finish:
- - ps: echo "on_finish start";
- - ps: Stop-Transcript
- - cmd: echo Build Version %APPVEYOR_BUILD_VERSION%
- # Add the chocolatey logs
- - cmd: mkdir %TestLogDir%\ChocolateyLogs
- - cmd: xcopy C:\ProgramData\chocolatey\logs %TestLogDir%\ChocolateyLogs /e /q & exit 0
- # Add the npm-cache logs
- - cmd: mkdir %TestLogDir%\npm-cache-logs
- - cmd: xcopy %APPDATA%\npm-cache\_logs %TestLogDir%\npm-cache-logs /s /q & exit 0
- # Zip and push test logs
- - cmd: xcopy %TestLogDir% %TestLogDirClone% /q /s /e & exit 0
- - cmd: 7z a -p"%APPVEYOR_BUILD_VERSION%" -r %BuildDir%\TestLogs.zip %TestLogDirClone%\* > null
- - ps: Push-AppveyorArtifact "$Env:BuildDir\TestLogs.zip" -FileName "TestLogs.zip"