-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add Android Designer test template
The designer team is no longer using the build and test templates in [yaml-templates][0], so there is not much value in us maintaining them externally. A copy of the test template has been moved into our repo, and the build and test steps have been updated to reflect the latest changes in the UITools repo. [0]: https://github.com/xamarin/yaml-templates/tree/89becd2759512ebd8fe560a53f6916cc684f0b4c/designer
- Loading branch information
Showing
2 changed files
with
97 additions
and
23 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
76 changes: 76 additions & 0 deletions
76
build-tools/automation/yaml-templates/run-designer-tests.yml
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,76 @@ | ||
parameters: | ||
designerSourcePath: $(System.DefaultWorkingDirectory) | ||
nunitConsoleVersion: '3.9.0' | ||
runAddinTests: true | ||
testResultArtifactName: Test Results - Designer - Windows | ||
|
||
steps: | ||
- task: DeleteFiles@1 | ||
displayName: Delete Test Outputs | ||
inputs: | ||
SourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests | ||
Contents: | | ||
CustomControlsOutput | ||
AndroidCustomControlsClass/obj | ||
AndroidCustomControlsBinding/obj | ||
AndroidCustomControls/obj | ||
AndroidCustomControlsClass/bin | ||
AndroidCustomControlsBinding/bin | ||
AndroidCustomControls/bin | ||
- task: NuGetCommand@2 | ||
displayName: Install NUnit.Console ${{ parameters.nunitConsoleVersion }} | ||
inputs: | ||
command: custom | ||
arguments: install NUnit.Console -version ${{ parameters.nunitConsoleVersion }} -OutputDirectory ${{ parameters.designerSourcePath }}/packages | ||
|
||
- powershell: | | ||
$nunitConsole = [IO.Path]::Combine("${{ parameters.designerSourcePath }}", "packages", "NUnit.ConsoleRunner.${{ parameters.nunitConsoleVersion }}", "tools", "nunit3-console.exe") | ||
if ([Environment]::OSVersion.Platform -eq "Unix") | ||
{ | ||
mono64 "$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" | ||
} | ||
else | ||
{ | ||
."$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" | ||
} | ||
displayName: Run Unit Tests | ||
workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin-tests/Debug | ||
|
||
- powershell: | | ||
if ([Environment]::OSVersion.Platform -eq "Unix") | ||
{ | ||
mono64 "--debug" "GuiUnit.exe" "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" | ||
} | ||
else | ||
{ | ||
.\GuiUnit.exe "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" | ||
} | ||
displayName: Run GUI Tests | ||
workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin/Debug | ||
condition: false # https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1583237 | ||
|
||
- task: PublishTestResults@2 | ||
displayName: Publish Core Unit Test Results | ||
inputs: | ||
testResultsFormat: NUnit | ||
testResultsFiles: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/**/TestResult_*.xml | ||
testRunTitle: Xamarin.AndroidDesigner.Tests | ||
condition: succeededOrFailed() | ||
|
||
- task: CopyFiles@2 | ||
displayName: 'Copy binlogs' | ||
inputs: | ||
sourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android | ||
contents: '**/*.binlog' | ||
targetFolder: $(Build.ArtifactStagingDirectory)/designer-binlogs | ||
overWrite: true | ||
flattenFolders: true | ||
condition: ne(variables['Agent.JobStatus'], 'Succeeded') | ||
|
||
- template: publish-artifact.yaml | ||
parameters: | ||
displayName: upload designer binlogs | ||
artifactName: ${{ parameters.testResultArtifactName }} | ||
targetPath: $(Build.ArtifactStagingDirectory)/designer-binlogs | ||
condition: ne(variables['Agent.JobStatus'], 'Succeeded') |