Skip to content

Commit d5e2c8c

Browse files
committed
add image_version parameter for unitTest.groovy
Signed-off-by: Oksana Salyk <oksana.salyk@hpe.com>
1 parent cb27887 commit d5e2c8c

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

vars/parseStageInfo.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ Map call(Map config = [:]) {
8888
result['distro_version'] = cachedCommitPragma('EL8-version',
8989
distroVersion(result['target']))
9090
new_ci_target = cachedCommitPragma('EL8-target', result['target'])
91+
} else if (stage_name.contains('EL 9.6')) {
92+
result['target'] = 'el9.6'
93+
result['distro_version'] = cachedCommitPragma('EL9.6-version', '9.6')
94+
new_ci_target = cachedCommitPragma('EL9.6-target', result['target'])
9195
} else if (stage_name.contains('EL 9')) {
9296
result['target'] = 'el9'
9397
result['distro_version'] = cachedCommitPragma('EL9-version',

vars/provisionNodes.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ Map call(Map config = [:]) {
142142
provision_script += 'EL_7'
143143
break
144144
case 'el8':
145-
case 'el9':
146145
provision_script += 'EL_8'
147146
break
147+
case 'el9':
148+
provision_script += 'EL_9'
149+
break
148150
case 'suse':
149151
provision_script += 'LEAP_15'
150152
break

vars/unitPackages.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Method to return the list of Unit Testing packages
1212
*/
1313

14-
String call() {
14+
String call(Map args = [:]) {
1515
String script = 'ci/unit/required_packages.sh'
1616
if (!fileExists(script)) {
1717
echo "${script} doesn't exist. " +
@@ -20,7 +20,8 @@ String call() {
2020
}
2121

2222
Map stage_info = parseStageInfo()
23-
String target = stage_info['target']
23+
String target = args.get('image_version') ?:
24+
(stage_info['target'] =~ /([a-z]+)(.*)/)[0][1] + stage_info['distro_version']
2425
boolean quick_build = quickBuild()
2526

2627
if (target.startsWith('centos') || target.startsWith('el')) {

vars/unitTest.groovy

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
* default is false.
7272
*
7373
* config['unstash_tests'] Un-stash -tests, default is true.
74+
*
75+
* config['image_version'] Image version to use for provisioning, e.g. el8.8, leap15.6, etc.
7476
*/
7577

7678
Map afterTest(Map config, Map testRunInfo) {
@@ -136,18 +138,22 @@ Map call(Map config = [:]) {
136138
}
137139
}
138140

141+
String image_version = config.get('image_version', '') ?:
142+
(stage_info['ci_target'] =~ /([a-z]+)(.*)/)[0][1] + stage_info['distro_version']
143+
144+
println("image_version = ${image_version}")
139145
Map runData = provisionNodes(
140146
NODELIST: nodelist,
141147
node_count: stage_info['node_count'],
142-
distro: (stage_info['ci_target'] =~
143-
/([a-z]+)(.*)/)[0][1] + stage_info['distro_version'],
148+
distro: image_version,
144149
inst_repos: config.get('inst_repos', ''),
145150
inst_rpms: inst_rpms)
146-
147-
String target_stash = "${stage_info['target']}-${stage_info['compiler']}"
151+
// image_version-compiler-build_type
152+
String target_stash = "${image_version}-${stage_info['compiler']}"
148153
if (stage_info['build_type']) {
149154
target_stash += '-' + stage_info['build_type']
150155
}
156+
println("target_stash = ${target_stash}")
151157

152158
List stashes = []
153159
if (config['stashes']) {

0 commit comments

Comments
 (0)