Skip to content

Commit

Permalink
Merge pull request #1457 from buildtesters/rename_buildspecs_roots
Browse files Browse the repository at this point in the history
Rename buildspecs_roots in configuration file to 'root'
  • Loading branch information
shahzebsiddiqui committed Apr 28, 2023
2 parents bf31126 + e9e0026 commit 0cd3e13
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
10 changes: 6 additions & 4 deletions buildtest/cli/buildspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,17 @@ def get_cache(self):
return self.cache

def load_paths(self):
"""Add all paths to search for buildspecs. We must read configuration file
and check property ``buildspec_roots`` for list of directories to search.
We check all directories exist, if any fail we don't add them to path.
"""Add all paths to search for buildspecs. We read configuration file
and check whether we need to load buildspecs from list of directories.
We check if directories exist, if any fail we don't add them to path.
If no root directories are specified we load the default buildspec roots which are
`tutorials <https://github.com/buildtesters/buildtest/tree/devel/tutorials>`_
and `general_tests <https://github.com/buildtesters/buildtest/tree/devel/general_tests>`_ directory.
"""

buildspec_paths = self.configuration.target_config.get("buildspec_roots") or []
buildspec_paths = (
self.configuration.target_config["buildspecs"].get("root") or []
)

if buildspec_paths:
self.roots += buildspec_paths
Expand Down
14 changes: 7 additions & 7 deletions buildtest/schemas/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
"minimum": 1,
"description": "Specify size of Process Pool for parallel processing using ``multiprocessing.Pool``"
},
"buildspec_roots": {
"type": "array",
"items": {
"type": "string"
},
"description": "Specify a list of directory paths to search buildspecs. This field can be used with ``buildtest buildspec find`` to rebuild buildspec cache or build tests using ``buildtest build`` command"
},
"testdir": {
"type": "string",
"description": "Specify full path to test directory where buildtest will write tests."
Expand Down Expand Up @@ -101,6 +94,13 @@
{
"type": "boolean",
"description": "A boolean to determine whether to enable paging when viewing buildspec cache"
},
"root": {
"type": "array",
"items": {
"type": "string"
},
"description": "Specify a list of directory paths to search buildspecs. This field can be used with ``buildtest buildspec find`` to rebuild buildspec cache or build tests using ``buildtest build`` command"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions buildtest/settings/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ system:
terse: False
# determine whether to enable pagination
pager: False
# specify list of directories to search for buildspecs when building cache
#root: [ $BUILDTEST_ROOT/examples, /tmp/buildspecs ]
executors:
# define local executors for running jobs locally
local:
Expand Down
14 changes: 6 additions & 8 deletions docs/configuring_buildtest/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -546,26 +546,24 @@ with ``pager: False`` but if you want to enable pagination you can run ``buildte
buildspec roots
-----------------

buildtest can discover buildspec using ``buildspec_roots`` keyword. This field is a list
buildtest can discover buildspec using ``root`` keyword. This field is a list
of directory paths to search for buildspecs. For example we clone the repo
https://github.com/buildtesters/buildtest-nersc at **$HOME/buildtest-nersc** and assign
this to **buildspec_roots** as follows:
this to **root** as follows:

.. code-block:: yaml
buildspec_roots:
buildspecs:
root:
- $HOME/buildtest-nersc
This field is used with the ``buildtest buildspec find`` command. If you rebuild
your buildspec cache via ``--rebuild`` option, buildtest will search for all buildspecs in
directories specified by **buildspec_roots** property. buildtest will recursively
directories specified by **root** property. buildtest will recursively
find all **.yml** extension and validate each buildspec with appropriate schema.

By default buildtest will add the ``$BUILDTEST_ROOT/tutorials`` and ``$BUILDTEST_ROOT/general_tests``
to search path when searching for buildspecs with ``buildtest buildspec find`` command. This
is only true if there is no root buildspec directory specified which can be done via `buildspec_roots`
or `--root` option.

to search path when searching for buildspecs with ``buildtest buildspec find`` command.

.. _cdash_configuration:

Expand Down

0 comments on commit 0cd3e13

Please sign in to comment.