Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
13e1ba4f
Commit
13e1ba4f
authored
4 years ago
by
Tamara Dahlgren
Browse files
Options
Downloads
Patches
Plain Diff
Switch command options to use build-env syntax
parent
8878c11c
Branches
features/spack-test-results-filterNlogs
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/spack/spack/cmd/test.py
+44
-16
44 additions, 16 deletions
lib/spack/spack/cmd/test.py
with
44 additions
and
16 deletions
lib/spack/spack/cmd/test.py
+
44
−
16
View file @
13e1ba4f
...
...
@@ -105,9 +105,16 @@ def setup_parser(subparser):
help
=
"
print the test log for each matching package
"
)
results_parser
.
add_argument
(
'
-f
'
,
'
--failed
'
,
action
=
'
store_true
'
,
help
=
"
only show results for failed tests
"
)
arguments
.
add_common_arguments
(
results_parser
,
[
'
constraint
'
])
help
=
"
only show results for failed tests of matching packages
"
)
results_parser
.
add_argument
(
'
names
'
,
nargs
=
argparse
.
REMAINDER
,
metavar
=
'
[name(s)] [-- installed_specs]...
'
,
help
=
"
suite names and installed package constraints
"
)
results_parser
.
epilog
=
'
Test results will be filtered by space-
'
\
'
separated suite name(s) and installed
\n
specs when provided.
'
\
'
If names are provided, then only results for those test
\n
suites
'
\
'
will be shown. If installed specs are provided, then ony results
'
\
'
\n
matching those specs will be shown.
'
# Remove
remove_parser
=
sp
.
add_parser
(
'
remove
'
,
help
=
test_remove
.
__doc__
)
...
...
@@ -245,20 +252,32 @@ def test_status(args):
tty
.
msg
(
"
Test suite %s completed
"
%
test_suite
.
name
)
def
_report_suite_results
(
test_suite
,
args
):
def
_report_suite_results
(
test_suite
,
args
,
constraints
):
"""
Report the relevant test suite results.
"""
# TODO: Make this handle capability tests too
# The results file may turn out to be a placeholder for future work
specs
=
args
.
specs
()
test_specs
=
{
test_suite
.
test_pkg_id
(
s
):
s
for
s
in
test_suite
.
specs
if
s
in
specs
}
if
constraints
:
# TBD: Should I be refactoring or re-using ConstraintAction?
qspecs
=
spack
.
cmd
.
parse_specs
(
constraints
)
specs
=
{}
for
spec
in
qspecs
:
for
s
in
spack
.
store
.
db
.
query
(
spec
,
installed
=
True
):
specs
[
s
.
dag_hash
()]
=
s
specs
=
sorted
(
specs
.
values
())
test_specs
=
{
test_suite
.
test_pkg_id
(
s
):
s
for
s
in
test_suite
.
specs
if
s
in
specs
}
else
:
test_specs
=
{
test_suite
.
test_pkg_id
(
s
):
s
for
s
in
test_suite
.
specs
}
if
not
test_specs
:
return
if
os
.
path
.
exists
(
test_suite
.
results_file
):
results_desc
=
'
Failing results
'
if
args
.
failed
else
'
Results
'
matching
=
"
, spec matching
'
{0}
'"
.
format
(
'
'
.
join
(
args
.
constraint
))
\
if
args
.
constraint
else
''
matching
=
"
, spec matching
'
{0}
'"
.
format
(
'
'
.
join
(
constraint
s
))
\
if
constraint
s
else
''
tty
.
msg
(
"
{0} for test suite
'
{1}
'
{2}:
"
.
format
(
results_desc
,
test_suite
.
name
,
matching
))
...
...
@@ -291,21 +310,30 @@ def _report_suite_results(test_suite, args):
def
test_results
(
args
):
"""
Get the results from Spack test suites (default all).
"""
name
=
''
if
args
.
constraint
and
'
:
'
in
args
.
constraint
[
0
]:
name
,
args
.
constraint
[
0
]
=
args
.
constraint
[
0
].
split
(
'
:
'
)
if
args
.
names
:
try
:
sep_index
=
args
.
names
.
index
(
'
--
'
)
names
=
args
.
names
[:
sep_index
]
constraints
=
args
.
names
[
sep_index
+
1
:]
except
ValueError
:
names
=
args
.
names
constraints
=
None
else
:
names
,
constraints
=
None
,
None
if
name
:
test_suites
=
[
spack
.
install_test
.
get_test_suite
(
name
)]
if
names
:
test_suites
=
[
spack
.
install_test
.
get_test_suite
(
name
)
for
name
in
names
]
if
not
test_suites
:
tty
.
msg
(
"
No test suite {0} found in test stage
"
.
format
(
name
))
tty
.
msg
(
'
No test suite(s) found in test stage: {0}
'
.
format
(
'
,
'
.
join
(
names
)))
else
:
test_suites
=
spack
.
install_test
.
get_all_test_suites
()
if
not
test_suites
:
tty
.
msg
(
"
No test suites with results to report
"
)
for
test_suite
in
test_suites
:
_report_suite_results
(
test_suite
,
args
)
_report_suite_results
(
test_suite
,
args
,
constraints
)
def
test_remove
(
args
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment