1
1
properties ([[$class : ' ParametersDefinitionProperty' , parameterDefinitions : [
2
- [$class : ' StringParameterDefinition' , name : ' mbed_os_revision' , defaultValue : ' mbed-os-5.4 ' , description : ' Revision of mbed-os to build' ],
2
+ [$class : ' StringParameterDefinition' , name : ' mbed_os_revision' , defaultValue : ' ' , description : ' Revision of mbed-os to build. To access mbed-os PR use format "pull/PR number/head" ' ],
3
3
[$class : ' BooleanParameterDefinition' , name : ' smoke_test' , defaultValue : true , description : ' Runs HW smoke tests on Cellular devices' ]
4
4
]]])
5
5
6
- echo " Run smoke tests: ${ params.smoke_test} "
7
-
8
- try {
9
- echo " Verifying build with mbed-os version ${ mbed_os_revision} "
10
- env. MBED_OS_REVISION = " ${ mbed_os_revision} "
11
- } catch (err) {
12
- def mbed_os_revision = " master"
13
- echo " Verifying build with mbed-os version ${ mbed_os_revision} "
14
- env. MBED_OS_REVISION = " ${ mbed_os_revision} "
6
+ if (env. MBED_OS_REVISION == null ) {
7
+ echo ' First run in this branch, using default parameter values'
8
+ env. MBED_OS_REVISION = ' '
9
+ }
10
+ if (env. MBED_OS_REVISION == ' ' ) {
11
+ echo ' Using mbed OS revision from mbed-os.lib'
12
+ } else {
13
+ echo " Using given mbed OS revision: ${ env.MBED_OS_REVISION} "
14
+ if (env. MBED_OS_REVISION . matches(' pull/\\ d+/head' )) {
15
+ echo " Revision is a Pull Request"
16
+ }
15
17
}
16
18
17
19
// Map RaaS instances to corresponding test suites
18
20
def raas = [
19
21
" cellular_smoke_ublox_c027.json" : " 8072"
20
- // Currently dragonfly is not supported by RAAS, skip it
21
- // "cellular_smoke_mts_dragonfly.json": "8072"
22
- ]
22
+ // "cellular_smoke_mtb_mts_dragonfly.json": "8119"
23
+ ]
23
24
24
25
// List of targets with supported modem families
25
26
def target_families = [
26
- " UBLOX" : [" UBLOX_C027" ]
27
- ]
27
+ " UBLOX" : [" UBLOX_C027" ],
28
+ " DRAGONFLY" : [" MTB_MTS_DRAGONFLY" ]
29
+ ]
28
30
29
31
// Supported Modems
30
32
def targets = [
31
- " UBLOX_C027"
33
+ " UBLOX_C027" ,
34
+ " MTB_MTS_DRAGONFLY"
32
35
]
33
36
34
37
// Map toolchains to compilers
35
38
def toolchains = [
36
39
ARM : " armcc" ,
37
40
GCC_ARM : " arm-none-eabi-gcc" ,
38
- IAR : " iar_arm"
41
+ IAR : " iar_arm" ,
42
+ ARMC6 : " arm6"
39
43
]
40
44
41
45
// supported socket tests
@@ -67,11 +71,11 @@ for (int i = 0; i < target_families.size(); i++) {
67
71
}
68
72
}
69
73
70
-
71
74
def parallelRunSmoke = [:]
72
75
73
76
// Need to compare boolean against string value
74
- if ( params. smoke_test == true ) {
77
+ if (params. smoke_test == true ) {
78
+ echo " Running smoke tests"
75
79
// Generate smoke tests based on suite amount
76
80
for (int i = 0 ; i < raas. size(); i++ ) {
77
81
for (int j = 0 ; j < sockets. size(); j++ ) {
@@ -84,6 +88,8 @@ if ( params.smoke_test == true ) {
84
88
parallelRunSmoke[smokeStep] = run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, socket)
85
89
}
86
90
}
91
+ } else {
92
+ echo " Skipping smoke tests"
87
93
}
88
94
89
95
timestamps {
@@ -110,9 +116,17 @@ def buildStep(target_family, target, compilerLabel, toolchain, socket) {
110
116
111
117
// Set mbed-os to revision received as parameter
112
118
execute (" mbed deploy --protocol ssh" )
113
- // dir ("mbed-os") {
114
- // execute ("git checkout ${env.MBED_OS_REVISION}")
115
- // }
119
+ if (env. MBED_OS_REVISION != ' ' ) {
120
+ dir(" mbed-os" ) {
121
+ if (env. MBED_OS_REVISION . matches(' pull/\\ d+/head' )) {
122
+ // Use mbed-os PR and switch to branch created
123
+ execute(" git fetch origin ${ env.MBED_OS_REVISION} :_PR_" )
124
+ execute(" git checkout _PR_" )
125
+ } else {
126
+ execute (" git checkout ${ env.MBED_OS_REVISION} " )
127
+ }
128
+ }
129
+ }
116
130
117
131
execute (" mbed compile --build out/${ target} _${ toolchain} / -m ${ target} -t ${ toolchain} -c --app-config ${ config_file} " )
118
132
}
@@ -132,11 +146,11 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, sock
132
146
def suiteName = suite_to_run. substring(0 , suite_to_run. indexOf(' .' ))
133
147
stage (" smoke_${ raasPort} _${ suiteName} " ) {
134
148
// node is actually the type of machine, i.e., mesh-test boild down to linux
135
- node (" mesh-test " ) {
149
+ node (" linux " ) {
136
150
deleteDir()
137
151
dir(" mbed-clitest" ) {
138
152
git
" [email protected] :ARMmbed/mbed-clitest.git"
139
- execute(" git checkout master " )
153
+ execute(" git checkout ${ env.LATEST_CLITEST_STABLE_REL } " )
140
154
dir(" mbed-clitest-suites" ) {
141
155
git
" [email protected] :ARMmbed/mbed-clitest-suites.git"
142
156
execute(" git submodule update --init --recursive" )
@@ -149,23 +163,19 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, sock
149
163
for (int i = 0 ; i < target_families. size(); i++ ) {
150
164
for (int j = 0 ; j < toolchains. size(); j++ ) {
151
165
for (int k = 0 ; k < targets. size(); k++ ) {
152
- def target_family = target_families. keySet(). asList(). get(i)
153
- def allowed_target_type = target_families. get(target_family)
154
- def target = targets. get(k)
155
- def toolchain = toolchains. keySet(). asList(). get(j)
156
-
157
- if (allowed_target_type. contains(target)) {
158
- unstash " ${ target} _${ toolchain} _${ socket} "
159
- }
160
- }
166
+ def target_family = target_families. keySet(). asList(). get(i)
167
+ def allowed_target_type = target_families. get(target_family)
168
+ def target = targets. get(k)
169
+ def toolchain = toolchains. keySet(). asList(). get(j)
170
+
171
+ if (allowed_target_type. contains(target)) {
172
+ unstash " ${ target} _${ toolchain} _${ socket} "
173
+ }
174
+ }
161
175
}
162
176
}
163
- if (" ${ suiteName} " == " cellular_smoke_mts_dragonfly" ) {
164
- execute(" python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${ suite_to_run} --type hardware --reset hard --raas 62.44.193.186:${ raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${ raasPort} _${ suiteName} " )
165
- } else {
166
- execute(" python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${ suite_to_run} --type hardware --reset --raas 62.44.193.186:${ raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${ raasPort} _${ suiteName} " )
167
- }
168
- archive " log_${ raasPort} _${ suiteName} /**/*"
177
+ execute(" python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${ suite_to_run} --type hardware --reset --raas 62.44.193.186:${ raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${ raasPort} _${ suiteName} " )
178
+ archive " log_${ raasPort} _${ suiteName} /**/*"
169
179
}
170
180
}
171
181
}
0 commit comments