summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelsagermann <57254519+elsagermann@users.noreply.github.com>2020-10-19 06:17:07 +0200
committerGitHub <noreply@github.com>2020-10-18 23:17:07 -0500
commit4750d479a09ceeb1e5f575337f7e851ec688b1e1 (patch)
tree5263c4701545eb6e904d82d16e679064fae76958
parent05ffbbc0befa26d520612b7e801c26d7e8bda28f (diff)
downloadspack-4750d479a09ceeb1e5f575337f7e851ec688b1e1.tar.gz
spack-4750d479a09ceeb1e5f575337f7e851ec688b1e1.tar.bz2
spack-4750d479a09ceeb1e5f575337f7e851ec688b1e1.tar.xz
spack-4750d479a09ceeb1e5f575337f7e851ec688b1e1.zip
Add testing option to dev-build command (#17293)
* ADD: testing to dev-build command * RM: mutally exclusive group for testing in parser * FIX: test option to subparser and not testing * ADD: spack-completion.bash * RM: local devbuildcosmo cmd * FIX: bad merge --drop-in -b --before options forgotten * FIX: --test place in spack-completion.bash * FIX: typo * FIX: blank line removing * FIX: trailing white space Co-authored-by: Elsa Germann <egermann@tsa-ln002.cm.cluster>
-rw-r--r--lib/spack/spack/cmd/dev_build.py14
-rwxr-xr-xshare/spack/spack-completion.bash2
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/dev_build.py b/lib/spack/spack/cmd/dev_build.py
index 55f5d201a9..80878f5c76 100644
--- a/lib/spack/spack/cmd/dev_build.py
+++ b/lib/spack/spack/cmd/dev_build.py
@@ -39,6 +39,13 @@ def setup_parser(subparser):
subparser.add_argument(
'--drop-in', type=str, dest='shell', default=None,
help="drop into a build environment in a new shell, e.g. bash, zsh")
+ subparser.add_argument(
+ '--test', default=None,
+ choices=['root', 'all'],
+ help="""If 'root' is chosen, run package tests during
+installation for top-level packages (but skip tests for dependencies).
+if 'all' is chosen, run package tests during installation for all
+packages. If neither are chosen, don't run tests for any packages.""")
arguments.add_common_arguments(subparser, ['spec'])
stop_group = subparser.add_mutually_exclusive_group()
@@ -91,7 +98,14 @@ def dev_build(self, args):
if args.no_checksum:
spack.config.set('config:checksum', False, scope='command_line')
+ tests = False
+ if args.test == 'all':
+ tests = True
+ elif args.test == 'root':
+ tests = [spec.name for spec in specs]
+
package.do_install(
+ tests=tests,
make_jobs=args.jobs,
keep_prefix=args.keep_prefix,
install_deps=not args.ignore_deps,
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 17bac4034f..08e154eaa0 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -719,7 +719,7 @@ _spack_deprecate() {
_spack_dev_build() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -j --jobs -d --source-path -i --ignore-dependencies -n --no-checksum --keep-prefix --skip-patch -q --quiet --drop-in -b --before -u --until --clean --dirty"
+ SPACK_COMPREPLY="-h --help -j --jobs -d --source-path -i --ignore-dependencies -n --no-checksum --keep-prefix --skip-patch -q --quiet --drop-in --test -b --before -u --until --clean --dirty"
else
_all_packages
fi