Skip to content

Commit

Permalink
Azure pipeline test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrahunt committed Oct 28, 2019
1 parent 62d1cc5 commit 4d42db8
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 29 deletions.
58 changes: 29 additions & 29 deletions .azure-pipelines/jobs/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python27-x86:
python.version: '2.7'
python.architecture: x86
#Python27-x86:
# python.version: '2.7'
# python.architecture: x86
Python37-x64:
python.version: '3.7'
python.architecture: x64
Expand All @@ -22,29 +22,29 @@ jobs:
parameters:
runIntegrationTests: true

- job: Test_Secondary
displayName: Test Secondary
# Don't run integration tests for these runs
# Run after Test_Primary so we don't devour time and jobs if tests are going to fail
dependsOn: Test_Primary

pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
# This is for Windows, so test x86 builds
Python35-x86:
python.version: '3.5'
python.architecture: x86
Python36-x86:
python.version: '3.6'
python.architecture: x86
Python37-x86:
python.version: '3.7'
python.architecture: x86
maxParallel: 5

steps:
- template: ../steps/run-tests-windows.yml
parameters:
runIntegrationTests: false
#- job: Test_Secondary
# displayName: Test Secondary
# # Don't run integration tests for these runs
# # Run after Test_Primary so we don't devour time and jobs if tests are going to fail
# dependsOn: Test_Primary
#
# pool:
# vmImage: ${{ parameters.vmImage }}
# strategy:
# matrix:
# # This is for Windows, so test x86 builds
# Python35-x86:
# python.version: '3.5'
# python.architecture: x86
# Python36-x86:
# python.version: '3.6'
# python.architecture: x86
# Python37-x86:
# python.version: '3.7'
# python.architecture: x86
# maxParallel: 5
#
# steps:
# - template: ../steps/run-tests-windows.yml
# parameters:
# runIntegrationTests: false
57 changes: 57 additions & 0 deletions .azure-pipelines/steps/run-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,61 @@ steps:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- powershell: |
function Ensure-Installed($featureName) {
$feature = Get-WindowsFeature -Name $featureName
if ($feature.Installed) {
return
}
if ($feature.InstallState -Ne "Available") {
throw "$featureName is not available"
}
$result = Install-WindowsFeature -Name $featureName
if (!$result.Success) {
throw "Feature $featureName failed installation: $result"
}
if ($result.RestartNeeded -Eq "Yes") {
throw "Restart needed to install $featureName"
}
}
Ensure-Installed FS-iSCSITarget-Server
Ensure-Installed iSCSITarget-VSS-VDS
# Allow connection on loopback interface.
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\iSCSI Target' -Name AllowLoopBack -Value 1
Start-Service msiscsi
$retry = 10
do
{
$count = (Get-Service msiscsi | ? {$_.status -eq "Running"}).count
$retry--
sleep -Milliseconds 500
} until ($count -Eq 0 -or $retry -Eq 0)
$service = Get-Service msiscsi
if ($service.Status -Ne "Running") {
throw "msiscsi not running"
}
#net start MSiSCSI
Get-NetFirewallServiceFilter -Service msiscsi | Enable-NetFirewallRule
New-IscsiVirtualDisk -ComputerName localhost -Path ramdisk:RAMDISK1.vhdx -Size 1GB
New-IscsiServerTarget Target1 -ComputerName localhost -InitiatorId "IQN:*"
Add-IscsiVirtualDiskTargetMapping -ComputerName localhost -TargetName Target1 -Path ramdisk:RAMDISK1.vhdx -Lun 1
New-IscsiTargetPortal -TargetPortalAddress 127.0.0.1
Get-IscsiTarget | Connect-IscsiTarget
Get-IscsiConnection | Get-Disk | Set-Disk -IsOffline $False
Get-IscsiConnection | Get-Disk | Initialize-Disk -PartitionStyle MBR
Get-IscsiConnection | Get-Disk | New-Partition -UseMaximumSize -AssignDriveLetter -DriveLetter R
Get-IscsiConnection | Get-Disk | Format-Volume -FileSystem NTFS -NewFileSystemLabel Temp -Confirm:$False
displayName: Test

- script: exit 1
displayName: Early return

- powershell: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?linkid=2026036 -OutFile adksetup.exe
./adksetup.exe /features OptionId.WindowsPerformanceToolkit /log adk-setup.log /ceip off /installpath "C:\Program Files (x86)\Windows Kits\10\"
Expand Down Expand Up @@ -39,6 +94,8 @@ steps:
--wpr-profile=GeneralProfile.verbose
--wpr-profile=CPU.verbose
--wpr-output=traces/wpr-result.etl
env:
TEMP: "R:\\"
displayName: Tox run unit tests

- script:
Expand Down

0 comments on commit 4d42db8

Please sign in to comment.