-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathtest-buildproj-job.yml
More file actions
109 lines (91 loc) · 3.81 KB
/
test-buildproj-job.yml
File metadata and controls
109 lines (91 loc) · 3.81 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#################################################################################
# Licensed to the .NET Foundation under one or more agreements. #
# The .NET Foundation licenses this file to you under the MIT license. #
# See the LICENSE file in the project root for more information. #
#################################################################################
parameters:
# General Parameters =====================================================
# Configuration with which to build the packages and execute the tests.
- name: buildConfiguration
type: string
values:
- Debug
- Release
# Suffix to append to the package version to indicate it is a pre-release/development build.
- name: buildSuffix
type: string
# Dotnet CLI verbosity level.
- name: dotnetVerbosity
type: string
default: normal
values:
- quiet
- minimal
- normal
- detailed
- diagnostic
# Platform Parameters ====================================================
# Display name of the platform. This will be formatted into the job's official name as well as
# the display name for the job. As such, only alphanumeric and _ characters are permitted.
- name: platformDisplayName
type: string
# TFM name of the version of dotnet to run this test with.
- name: platformDotnet
type: string
# Name of the image in the customized ADO pool to use to execute this job.
- name: platformImage
type: string
# Name of the pool to use for jobs that require customized VM images.
- name: poolName
type: string
# Test Parameters ========================================================
# Name of the project to run tests for. This will be used to generate the build.proj target to
# execute: Test{packageShortName}{testProject}
- name: packageShortName
type: string
values:
- Azure
- AkvProvider
- Abstractions
- Logging
- SqlClient
- SqlServer
# Display name of the test target that is being executed. This will be formatted into the job's
# official name as well as the display name for the job. As such, only alphanumeric and _
# characters are permitted.
- name: testDisplayName
type: string
# Optional test project name to execute. This only applies to packages that have >1 test target.
# eg, for TestSqlClientManual, this should be "Manual"
- name: testProject
type: string
default: ''
jobs:
- job: "test_${{ parameters.platformDisplayName }}_${{ parameters.testDisplayName }}"
displayName: "${{ parameters.testDisplayName }}_${{ parameters.platformDisplayName }}"
pool:
name: ${{ parameters.poolName }}
demands:
- imageOverride -equals ${{ parameters.platformImage }}
steps:
# Install dotnet and the runtime that will run the tests (if it is not netframework)
- template: /eng/pipelines/common/steps/install-dotnet.yml@self
parameters:
${{ if not(contains(parameters.platformDotnet, 'net4')) }}:
runtimes:
- "${{ replace(parameters.platformDotnet, 'net', '') }}.x"
# Restore dotnet tools
- template: /eng/pipelines/common/steps/restore-dotnet-tools.yml@self
# Execute the test target
- task: DotNetCoreCLI@2
displayName: 'Test: ${{ parameters.packageShortName }}${{ parameters.testProject }}'
inputs:
command: build
projects: build.proj
verbosity: ${{ parameters.dotnetVerbosity }}
arguments: >-
-t:Test${{ parameters.packageShortName }}${{ parameters.testProject }}
-p:Configuration=${{ parameters.buildConfiguration }}
-p:BuildNumber='$(Build.BuildNumber)'
-p:BuildSuffix='${{ parameters.buildSuffix }}'
-p:TestFramework=${{ parameters.platformDotnet }}