-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathtest-steps.yml
More file actions
66 lines (59 loc) · 2.29 KB
/
test-steps.yml
File metadata and controls
66 lines (59 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
parameters:
osName: ''
testFramework: ''
testTarget: ''
configuration: ''
steps:
- template: download-build-steps.yml
parameters:
osName: ${{ parameters.osName }}
- task: NodeTool@0
condition: eq(variables.IsGenerateBased, true)
displayName: Install autorest
inputs:
versionSpec: '14.17.1'
command: custom
verbose: false
customCommand: install autorest@latest
- task: PowerShell@2
condition: eq(variables.IsGenerateBased, true)
displayName: Setup environment for autorest
inputs:
targetType: inline
script: "$env:NODE_OPTIONS=\"--max-old-space-size=65536\""
pwsh: true
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.1.x
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
- powershell: |
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force -SkipPublisherCheck
Install-Module -Name Az.Accounts -Scope CurrentUser -Force
$env:PSModulePath = $env:PSModulePath + ";" + (pwd).Path
Get-ChildItem -File -Recurse -Depth 1 test-module.ps1 | ForEach-Object {. $_; if ($LastExitCode -ne 0) {throw "test fails when executing $_"}}
workingDirectory: 'artifacts/Debug'
displayName: Test for AutoGen Modules With Windows PowerShell
condition: and(succeeded(), ne('${{ parameters.testTarget }}', 'Test'))
- pwsh: |
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force
Install-Module -Name Az.Accounts -Scope CurrentUser -Force
if ($IsWindows) { $sp = ";" } else { $sp = ":" }
$env:PSModulePath = $env:PSModulePath + $sp + (pwd).Path
Get-ChildItem -File -Recurse -Depth 1 test-module.ps1 | ForEach-Object {. $_; if ($LastExitCode -ne 0) {throw "test fails when executing $_"}}
workingDirectory: 'artifacts/Debug'
displayName: 'Test for AutoGen Modules With PowerShell Core'
condition: and(succeeded(), eq('${{ parameters.testTarget }}', 'Test'))
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- template: publish-artifacts-steps.yml
parameters:
artifactName: test-${{ parameters.osName }}