blob: 6b042f8c68e4f2a6ec43ad5d6bdfe8f28241f46e (
plain)
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
|
@Library('dotnet-ci') _
// Incoming parameters. Access with "params.<param name>".
// Note that the parameters will be set as env variables so we cannot use names that conflict
// with the engineering system parameter names.
// TGroup - The target framework to build.
// CGroup - Build configuration.
// TestOuter - If true, runs outerloop, if false runs just innerloop
def submittedHelixJson = null
def submitToHelix = (params.TGroup == 'netcoreapp' || params.TGroup == 'uap')
simpleNode('Windows_NT','latest') {
stage ('Checkout source') {
retry (10) {
checkout scm
}
}
def logFolder = getLogFolder()
def framework = ''
if (params.TGroup == 'all') {
framework = '-allConfigurations'
}
else {
framework = "-framework:${params.TGroup}"
}
def buildTests = (params.TGroup != 'all')
stage ('Initialize tools') {
// Init tools
bat '.\\init-tools.cmd'
}
stage ('Sync') {
bat ".\\sync.cmd -p -- /p:ArchGroup=${params.AGroup} /p:RuntimeOS=win10"
}
stage ('Generate Version Assets') {
bat '.\\build-managed.cmd -GenerateVersion'
}
stage ('Build Product') {
bat ".\\build.cmd ${framework} -buildArch=${params.AGroup} -${params.CGroup} -- /p:RuntimeOS=win10"
}
if (buildTests) {
stage ('Build Tests') {
def additionalArgs = ''
def archiveTests = 'false'
if (params.TestOuter) {
additionalArgs += ' -Outerloop'
}
if (submitToHelix) {
archiveTests = 'true'
}
if (submitToHelix || params.TGroup == 'uapaot') {
additionalArgs += ' -SkipTests'
}
bat ".\\build-tests.cmd ${framework} -buildArch=${params.AGroup} -${params.CGroup}${additionalArgs} -- /p:RuntimeOS=win10 /p:ArchiveTests=${archiveTests}"
}
}
if (submitToHelix) {
stage ('Submit To Helix For Testing') {
// Bind the credentials
withCredentials([string(credentialsId: 'CloudDropAccessToken', variable: 'CloudDropAccessToken'),
string(credentialsId: 'OutputCloudResultsAccessToken', variable: 'OutputCloudResultsAccessToken')]) {
// Ask the CI SDK for a Helix source that makes sense. This ensures that this pipeline works for both PR and non-PR cases
def helixSource = getHelixSource()
// Ask the CI SDK for a Build that makes sense. We currently use the hash for the build
def helixBuild = getCommit()
// Get the user that should be associated with the submission
def helixCreator = getUser()
// Target queues
def targetHelixQueues = []
if (params.TGroup == 'netcoreapp')
{
targetHelixQueues = ['Windows.10.Amd64.Open',
'Windows.7.Amd64.Open',
'Windows.81.Amd64.Open']
if (params.AGroup == 'x64') {
targetHelixQueues += ['Windows.10.Nano.Amd64.Open']
}
} else if (params.TGroup == 'uap') {
targetHelixQueues = ['Windows.10.Amd64.ClientRS2.Open']
}
bat "\"%VS140COMNTOOLS%\\VsDevCmd.bat\" && msbuild src\\upload-tests.proj /p:TargetGroup=${params.TGroup} /p:ArchGroup=${params.AGroup} /p:ConfigurationGroup=${params.CGroup} /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Windows_NT /p:HelixJobType=test/functional/cli/ /p:HelixSource=${helixSource} /p:BuildMoniker=${helixBuild} /p:HelixCreator=${helixCreator} /p:CloudDropAccountName=dotnetbuilddrops /p:CloudResultsAccountName=dotnetjobresults /p:CloudDropAccessToken=%CloudDropAccessToken% /p:CloudResultsAccessToken=%OutputCloudResultsAccessToken% /p:HelixApiEndpoint=https://helix.dot.net/api/2017-04-14/jobs /p:TargetQueues=\"${targetHelixQueues.join(',')}\" /p:HelixLogFolder= /p:HelixLogFolder=${WORKSPACE}\\${logFolder}\\ /p:HelixCorrelationInfoFileName=SubmittedHelixRuns.txt"
submittedHelixJson = readJSON file: "${logFolder}\\SubmittedHelixRuns.txt"
}
}
}
}
if (submitToHelix) {
stage ('Execute Tests') {
def contextBase
if (params.TestOuter) {
contextBase = "Win tests w/outer - ${params.TGroup} ${params.AGroup} ${params.CGroup}"
}
else {
contextBase = "Win tests - ${params.TGroup} ${params.AGroup} ${params.CGroup}"
}
waitForHelixRuns(submittedHelixJson, contextBase)
}
}
|