|
| 1 | +parameters: |
| 2 | + designerSourcePath: $(System.DefaultWorkingDirectory) |
| 3 | + nunitConsoleVersion: '3.9.0' |
| 4 | + runAddinTests: true |
| 5 | + testResultArtifactName: Test Results - Designer - Windows |
| 6 | + |
| 7 | +steps: |
| 8 | +- task: DeleteFiles@1 |
| 9 | + displayName: Delete Test Outputs |
| 10 | + inputs: |
| 11 | + SourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests |
| 12 | + Contents: | |
| 13 | + CustomControlsOutput |
| 14 | + AndroidCustomControlsClass/obj |
| 15 | + AndroidCustomControlsBinding/obj |
| 16 | + AndroidCustomControls/obj |
| 17 | + AndroidCustomControlsClass/bin |
| 18 | + AndroidCustomControlsBinding/bin |
| 19 | + AndroidCustomControls/bin |
| 20 | +
|
| 21 | +- task: NuGetCommand@2 |
| 22 | + displayName: Install NUnit.Console ${{ parameters.nunitConsoleVersion }} |
| 23 | + inputs: |
| 24 | + command: custom |
| 25 | + arguments: install NUnit.Console -version ${{ parameters.nunitConsoleVersion }} -OutputDirectory ${{ parameters.designerSourcePath }}/packages |
| 26 | + |
| 27 | +- powershell: | |
| 28 | + $nunitConsole = [IO.Path]::Combine("${{ parameters.designerSourcePath }}", "packages", "NUnit.ConsoleRunner.${{ parameters.nunitConsoleVersion }}", "tools", "nunit3-console.exe") |
| 29 | + if ([Environment]::OSVersion.Platform -eq "Unix") |
| 30 | + { |
| 31 | + mono64 "$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" |
| 32 | + } |
| 33 | + else |
| 34 | + { |
| 35 | + ."$nunitConsole" "-labels=All" "-result=TestResult_AndroidDesignerUnitTests.xml" "Xamarin.AndroidDesigner.UnitTests.dll" |
| 36 | + } |
| 37 | + displayName: Run Unit Tests |
| 38 | + workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin-tests/Debug |
| 39 | + |
| 40 | +- powershell: | |
| 41 | + if ([Environment]::OSVersion.Platform -eq "Unix") |
| 42 | + { |
| 43 | + mono64 "--debug" "GuiUnit.exe" "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" |
| 44 | + } |
| 45 | + else |
| 46 | + { |
| 47 | + .\GuiUnit.exe "-labels=All" "-result=TestResult_AndroidDesigner.xml" "Xamarin.AndroidDesigner.Tests.dll" |
| 48 | + } |
| 49 | + displayName: Run GUI Tests |
| 50 | + workingDirectory: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/bin/Debug |
| 51 | + condition: false # https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1583237 |
| 52 | + |
| 53 | +- task: PublishTestResults@2 |
| 54 | + displayName: Publish Core Unit Test Results |
| 55 | + inputs: |
| 56 | + testResultsFormat: NUnit |
| 57 | + testResultsFiles: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android/Xamarin.AndroidDesigner.Tests/**/TestResult_*.xml |
| 58 | + testRunTitle: Xamarin.AndroidDesigner.Tests |
| 59 | + condition: succeededOrFailed() |
| 60 | + |
| 61 | +- task: CopyFiles@2 |
| 62 | + displayName: 'Copy binlogs' |
| 63 | + inputs: |
| 64 | + sourceFolder: ${{ parameters.designerSourcePath }}/Xamarin.Designer.Android |
| 65 | + contents: '**/*.binlog' |
| 66 | + targetFolder: $(Build.ArtifactStagingDirectory)/designer-binlogs |
| 67 | + overWrite: true |
| 68 | + flattenFolders: true |
| 69 | + condition: ne(variables['Agent.JobStatus'], 'Succeeded') |
| 70 | + |
| 71 | +- template: publish-artifact.yaml |
| 72 | + parameters: |
| 73 | + displayName: upload designer binlogs |
| 74 | + artifactName: ${{ parameters.testResultArtifactName }} |
| 75 | + targetPath: $(Build.ArtifactStagingDirectory)/designer-binlogs |
| 76 | + condition: ne(variables['Agent.JobStatus'], 'Succeeded') |
0 commit comments