Skip to content

Commit

Permalink
Adding test stuff (#3902)
Browse files Browse the repository at this point in the history
Co-authored-by: Felipe da Conceicao Guimaraes <felipeda@microsoft.com>
  • Loading branch information
guimafelipe and Felipe da Conceicao Guimaraes authored Sep 26, 2024
1 parent c916788 commit 3de606d
Show file tree
Hide file tree
Showing 13 changed files with 451 additions and 92 deletions.
138 changes: 99 additions & 39 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ parameters:
default:
- Debug
- Release
- name: "holdTrigger"
displayName: CloudTest HoldTrigger setting
type: string
default: None
values:
- None
- Completion
- Execution
- Failure
- Timeout

variables:
# MSIXVersion's second part should always be odd to account for stub app's version
Expand Down Expand Up @@ -122,10 +132,6 @@ extends:
targetPath: DevHomeStub\DevHomeStubPackage\AppxPackages

- stage: Build_DevHome
dependsOn: Build_SDK
condition: in(dependencies.Build_SDK.result, 'Succeeded')
variables:
VersionOfSDK: $[stageDependencies.Build_SDK.Build_SDK.outputs['BuildSDKCommand.VersionOfSDK']]
jobs:
- ${{ each configuration in parameters.Configurations }}:
- ${{ each platform in parameters.Platforms }}:
Expand All @@ -141,12 +147,6 @@ extends:
inputs:
filePath: 'build/scripts/Unstub.ps1'

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'SdkNugetPackage'
targetPath: '$(Pipeline.Workspace)\sdkArtifacts\'

- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@4
displayName: Send and Download Localization Files for Artifacts
condition: and(eq(variables['EnableLocalization'], 'true'), eq(variables['UpdateLocalization'], 'true'))
Expand Down Expand Up @@ -295,35 +295,54 @@ extends:
# env:
# AzureServicesAuthConnectionString: $(ApiScanConnectionString)

- task: Windows Application Driver@0
condition: and(always(), ne('${{ platform}}', 'arm64'))
- task: CopyFiles@2
displayName: Copy Unit Test DLLs
inputs:
OperationType: 'Start'
#SourceFolder: # string. Source Folder.
Contents: 'test/bin/**/*' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: PowerShell@2
displayName: 'Run Unittests'
condition: ne('${{ platform}}', 'arm64')
- task: CopyFiles@2
displayName: Copy Tools Unit Test DLLs
inputs:
#SourceFolder: # string. Source Folder.
Contents: 'tools/*/*UnitTest/bin/**/*' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: CopyFiles@2
displayName: Copy UI Test DLLs
inputs:
#SourceFolder: # string. Source Folder.
Contents: 'uitest/bin/**/*' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: CopyFiles@2
displayName: Copy Tools UI Test DLLs
inputs:
#SourceFolder: # string. Source Folder.
Contents: 'tools/*/*UITest/bin/**/*' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: CopyFiles@2
displayName: Copy TestMap and TestGroup xmls
inputs:
filePath: 'Test.ps1'
arguments: -Platform "${{ platform }}" -Configuration "${{ configuration }}" -IsAzurePipelineBuild
#SourceFolder: # string. Source Folder.
Contents: 'uitest/*.xml' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: Windows Application Driver@0
condition: and(always(), ne('${{ platform}}', 'arm64'))
- task: CopyFiles@2
displayName: Copy run settings
inputs:
OperationType: 'Stop'
#SourceFolder: # string. Source Folder.
Contents: 'uitest/Test.runsettings' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

- task: PublishTestResults@2
displayName: 'Add Test Results to ADO'
condition: and(always(), ne('${{ platform}}', 'arm64'))
- task: CopyFiles@2
displayName: Copy Setup and Cleanup scripts
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(testOutputArtifactDir)'
mergeTestResults: true
failTaskOnFailedTests: true
testRunTitle: '$(Agent.JobName)'
buildPlatform: '${{ platform }}'
buildConfiguration: '${{ configuration }}'
#SourceFolder: # string. Source Folder.
Contents: 'uitest/UITest*.ps1' # string. Required. Contents. Default: *
targetFolder: '$(Build.ArtifactStagingDirectory)\unittest'

templateContext:
outputs:
Expand All @@ -340,19 +359,60 @@ extends:
targetPath: LocArchive
sbomPackageName: devhome.locoutput
sbomPackageVersion: $(MSIXVersion)
- output: pipelineArtifact
displayName: 'Publish Test Results'
condition: and(always(), ne('${{ platform}}', 'arm64'))
artifactName: TestResults_${{ platform }}_${{ configuration }}
targetPath: $(testOutputArtifactDir)
sbomPackageName: devhome.testresults
sbomPackageVersion: $(MSIXVersion)
- output: pipelineArtifact
displayName: Publish MSIX Artifact
artifactName: msix_${{ platform }}_${{ configuration }}
targetPath: $(appxPackageDir)\${{ configuration }}
sbomPackageName: devhome.msixpackage
sbomPackageVersion: $(MSIXVersion)
- output: pipelineArtifact
displayName: Publish Test Artifacts
artifactName: DevHomeUITests_${{ platform }}_${{ configuration }}
targetPath: $(Build.ArtifactStagingDirectory)\unittest
sbomPackageName: devhome.msixpackage
sbomPackageVersion: $(MSIXVersion)

- stage: Test
dependsOn: [Build_DevHome]
condition: ${{ containsValue(parameters.Configurations, 'release') }}
jobs:
- job: DevHomeWin11x64Test
pool: server
displayName: 'Dev Home Windows 11 Tests'
condition: ${{ containsValue(parameters.Platforms, 'x64') }}
timeoutInMinutes: 120
steps:
- task: asg-cloudtest.asg-cloudtest-servertasks.1ED2E272-8122-4964-9A8B-E1112FC306AA.CloudTestServerBuildTask@1
displayName: 'CloudTest Agentless Task'
inputs:
connectedServiceName: 'DevHomeCloudTest'
cloudTestTenant: devhomecloudtest
testMapLocation: '[BuildRoot]\uitest\TestMapWin11x64.xml'
pipelineArtifactName: DevHomeUITests_x64_Release
pipelineArtifactBuildUrl: '$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
buildDropArtifactName: ''
parserProperties: 'worker:VsTestVersion=V150;session:HoldTrigger=${{ parameters.holdTrigger }};VstsTestResultAttachmentUploadBehavior=Always;Provider:[MsixArtifacts]:PipelineArtifactBuildUrl=$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId);'
notificationSubscribers: 'dream'
scheduleBuildRequesterAlias: 'dream'

- job: DevHomeWin10x64Test
pool: server
displayName: 'Dev Home Windows 10 Tests'
condition: ${{ containsValue(parameters.Platforms, 'x64') }}
timeoutInMinutes: 120
steps:
- task: asg-cloudtest.asg-cloudtest-servertasks.1ED2E272-8122-4964-9A8B-E1112FC306AA.CloudTestServerBuildTask@1
displayName: 'CloudTest Agentless Task'
inputs:
connectedServiceName: 'DevHomeCloudTest'
cloudTestTenant: devhomecloudtest
testMapLocation: '[BuildRoot]\uitest\TestMapWin10x64.xml'
pipelineArtifactName: DevHomeUITests_x64_Release
pipelineArtifactBuildUrl: '$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
buildDropArtifactName: ''
parserProperties: 'worker:VsTestVersion=V150;session:HoldTrigger=${{ parameters.holdTrigger }};VstsTestResultAttachmentUploadBehavior=Always;Provider:[MsixArtifacts]:PipelineArtifactBuildUrl=$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId);'
notificationSubscribers: 'dream'
scheduleBuildRequesterAlias: 'dream'

- stage: Build_MsixBundle
dependsOn: [Build_DevHome, Build_StubPackages]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,30 @@
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -77,6 +81,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ControlFlowGuard>Guard</ControlFlowGuard>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -91,6 +97,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -105,6 +112,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ControlFlowGuard>Guard</ControlFlowGuard>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -119,6 +128,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,42 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|ARM'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|ARM64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|Win32'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|x64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
Expand Down Expand Up @@ -143,17 +179,35 @@
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Guard</ControlFlowGuard>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_FailFast'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|ARM'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|ARM64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|Win32'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|x64'">Guard</ControlFlowGuard>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|ARM64'">ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|Win32'">ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug_FailFast|x64'">ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Guard</ControlFlowGuard>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
Loading

0 comments on commit 3de606d

Please sign in to comment.