Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1257,12 +1257,12 @@ General Configuration
The command-line option sets the configuration option to ``false``.


.. js:attribute:: .general[].git_clone_timeout
.. js:attribute:: .general[].git_timeout

:required: No
:default: 5

Timeout value in seconds that will be used while cloning git repositories.
Timeout value in seconds used when checking if a git repository exists.


.. js:attribute:: .general[].remote_detect
Expand Down
6 changes: 3 additions & 3 deletions docs/manpage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,16 @@ Here is an alphabetical list of the environment variables recognized by ReFrame:
================================== ==================


.. envvar:: RFM_GIT_CLONE_TIMEOUT
.. envvar:: RFM_GIT_TIMEOUT

Timeout in seconds for the ``git clone`` commands.
Timeout value in seconds used when checking if a git repository exists.

.. table::
:align: left

================================== ==================
Associated command line option N/A
Associated configuration parameter :js:attr:`git_clone_timeout` general configuration parameter.
Associated configuration parameter :js:attr:`git_timeout` general configuration parameter.
================================== ==================


Expand Down
2 changes: 1 addition & 1 deletion reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ def _clone_to_stagedir(self, url):
self.logger.debug(f'Cloning URL {url} into stage directory')
osext.git_clone(
self.sourcesdir, self._stagedir,
timeout=rt.runtime().get_option('general/0/git_clone_timeout')
timeout=rt.runtime().get_option('general/0/git_timeout')
)

@final
Expand Down
9 changes: 5 additions & 4 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,11 @@ def main():

# Options not associated with command-line arguments
argparser.add_argument(
dest='git_clone_timeout',
envvar='RFM_GIT_CLONE_TIMEOUT',
configvar='general/git_clone_timeout',
help='Timeout in seconds of git clone commands'
dest='git_timeout',
envvar='RFM_GIT_TIMEOUT',
configvar='general/git_timeout',
help=('Timeout in seconds when checking if the url is a '
'valid repository.')
)
argparser.add_argument(
dest='graylog_server',
Expand Down
4 changes: 2 additions & 2 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"check_search_recursive": {"type": "boolean"},
"clean_stagedir": {"type": "boolean"},
"colorize": {"type": "boolean"},
"git_clone_timeout": {"type": "number"},
"git_timeout": {"type": "number"},
"ignore_check_conflicts": {"type": "boolean"},
"trap_job_errors": {"type": "boolean"},
"keep_stage_files": {"type": "boolean"},
Expand Down Expand Up @@ -498,7 +498,7 @@
"general/check_search_recursive": false,
"general/clean_stagedir": true,
"general/colorize": true,
"general/git_clone_timeout": 5,
"general/git_timeout": 5,
"general/ignore_check_conflicts": false,
"general/trap_job_errors": false,
"general/keep_stage_files": false,
Expand Down
6 changes: 3 additions & 3 deletions reframe/utility/osext.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ def git_clone(url, targetdir=None, timeout=5):
'''Clone a git repository from a URL.

:arg url: The URL to clone from.
:arg timeout: Timeout in seconds.
:arg timeout: Timeout in seconds when checking if the url is a valid
repository.
:arg targetdir: The directory where the repository will be cloned to. If
:class:`None`, a new directory will be created with the repository
name as if ``git clone {url}`` was issued.
Expand All @@ -428,8 +429,7 @@ def git_clone(url, targetdir=None, timeout=5):
raise ReframeError('git repository does not exist')

targetdir = targetdir or ''
run_command(f'git clone {url} {targetdir}', check=True,
timeout=timeout)
run_command(f'git clone {url} {targetdir}', check=True)


def git_repo_exists(url, timeout=5):
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_select_subconfig_optional_section_absent():
site_config = config.load_config('reframe/core/settings.py')
site_config.select_subconfig()
assert site_config.get('general/0/colorize') is True
assert site_config.get('general/0/git_clone_timeout') == 5
assert site_config.get('general/0/git_timeout') == 5
assert site_config.get('general/verbose') == 0


Expand Down