Skip to content

Commit f7db90a

Browse files
author
Vasileios Karakasis
authored
Merge pull request #2137 from mahendrapaipuri/feature/emit-image-name-gen-ci
[feat] Pass parent CI image name and ReFrame verbosity level in the generated Gitlab child pipelines
2 parents 5dffa31 + 8f5f123 commit f7db90a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

reframe/frontend/ci.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6+
import os
67
import sys
78
import yaml
89

@@ -18,6 +19,7 @@ def _emit_gitlab_pipeline(testcases):
1819
prefix = 'rfm-stage/${CI_COMMIT_SHORT_SHA}'
1920
checkpath = config.get('general/0/check_search_path')
2021
recurse = config.get('general/0/check_search_recursive')
22+
verbosity = 'v' * config.get('general/0/verbose')
2123

2224
def rfm_command(testcase):
2325
if config.filename != '<builtin>':
@@ -40,6 +42,7 @@ def rfm_command(testcase):
4042
f'-R' if recurse else '',
4143
f'--report-file={report_file}',
4244
f'--restore-session={restore_files}' if restore_files else '',
45+
f'{"".join("-" + verbosity)}' if verbosity else '',
4346
'-n', f"'^{testcase.check.name}$'", '-r'
4447
])
4548

@@ -51,6 +54,13 @@ def rfm_command(testcase):
5154
},
5255
'stages': []
5356
}
57+
58+
# Name of the image used for CI. If user does not explicitly provide
59+
# image keyword on the top of CI script, this variable does not exist
60+
image_name = os.getenv('CI_JOB_IMAGE')
61+
if image_name:
62+
json['image'] = image_name
63+
5464
for tc in testcases:
5565
json[f'{tc.check.name}'] = {
5666
'stage': f'rfm-stage-{tc.level}',

0 commit comments

Comments
 (0)