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
847c1216
Commit
847c1216
authored
7 years ago
by
Zack Galbreath
Committed by
Todd Gamblin
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Generate CDash reports for build/install step
parent
ae0ba373
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/report.py
+33
-2
33 additions, 2 deletions
lib/spack/spack/report.py
templates/reports/cdash/Build.xml
+27
-0
27 additions, 0 deletions
templates/reports/cdash/Build.xml
with
60 additions
and
2 deletions
lib/spack/spack/report.py
+
33
−
2
View file @
847c1216
...
...
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
"""
Tools to produce reports of spec installations
"""
import
codecs
import
collections
import
functools
import
itertools
...
...
@@ -33,6 +34,7 @@
import
time
import
traceback
import
xml.sax.saxutils
from
six
import
text_type
import
llnl.util.lang
import
spack.build_environment
...
...
@@ -294,7 +296,9 @@ def cdash_build_report(self, report_data):
'
autoreconf
'
:
'
configure
'
,
'
cmake
'
:
'
configure
'
,
'
configure
'
:
'
configure
'
,
'
edit
'
:
'
configure
'
'
edit
'
:
'
configure
'
,
'
build
'
:
'
build
'
,
'
install
'
:
'
build
'
}
# Initialize data structures common to each phase's report.
...
...
@@ -344,11 +348,38 @@ def cdash_build_report(self, report_data):
if
phase
==
'
configure
'
and
nerrors
>
0
:
report_data
[
phase
][
'
status
'
]
=
1
if
phase
==
'
build
'
:
# Convert log output from ASCII to Unicode and escape for XML.
def
clean_log_event
(
event
):
event
=
vars
(
event
)
event
[
'
text
'
]
=
xml
.
sax
.
saxutils
.
escape
(
event
[
'
text
'
])
event
[
'
pre_context
'
]
=
xml
.
sax
.
saxutils
.
escape
(
'
\n
'
.
join
(
event
[
'
pre_context
'
]))
event
[
'
post_context
'
]
=
xml
.
sax
.
saxutils
.
escape
(
'
\n
'
.
join
(
event
[
'
post_context
'
]))
# source_file and source_line_no are either strings or
# the tuple (None,). Distinguish between these two cases.
if
event
[
'
source_file
'
][
0
]
is
None
:
event
[
'
source_file
'
]
=
''
event
[
'
source_line_no
'
]
=
''
else
:
event
[
'
source_file
'
]
=
xml
.
sax
.
saxutils
.
escape
(
event
[
'
source_file
'
])
return
event
report_data
[
phase
][
'
errors
'
]
=
[]
report_data
[
phase
][
'
warnings
'
]
=
[]
for
error
in
errors
:
report_data
[
phase
][
'
errors
'
].
append
(
clean_log_event
(
error
))
for
warning
in
warnings
:
report_data
[
phase
][
'
warnings
'
].
append
(
clean_log_event
(
warning
))
# Write the report.
report_name
=
phase
.
capitalize
()
+
"
.xml
"
phase_report
=
os
.
path
.
join
(
self
.
filename
,
report_name
)
with
open
(
phase_report
,
'
w
'
)
as
f
:
with
codecs
.
open
(
phase_report
,
'
w
'
,
'
utf-8
'
)
as
f
:
env
=
spack
.
tengine
.
make_environment
()
site_template
=
os
.
path
.
join
(
templates
[
self
.
format_name
],
'
Site.xml
'
)
...
...
This diff is collapsed.
Click to expand it.
templates/reports/cdash/Build.xml
0 → 100644
+
27
−
0
View file @
847c1216
<Build>
<StartBuildTime>
{{ build.starttime }}
</StartBuildTime>
<BuildCommand>
{{ install_command }}
</BuildCommand>
{% for warning in build.warnings %}
<Warning>
<BuildLogLine>
{{ warning.line_no }}
</BuildLogLine>
<Text>
{{ warning.text }}
</Text>
<SourceFile>
{{ warning.source_file }}
</SourceFile>
<SourceLineNumber>
{{ warning.source_line_no }}
</SourceLineNumber>
<PreContext>
{{ warning.pre_context }}
</PreContext>
<PostContext>
{{ warning.post_context }}
</PostContext>
</Warning>
{% endfor %}
{% for error in build.errors %}
<Error>
<BuildLogLine>
{{ error.line_no }}
</BuildLogLine>
<Text>
{{ error.text }}
</Text>
<SourceFile>
{{ error.source_file }}
</SourceFile>
<SourceLineNumber>
{{ error.source_line_no }}
</SourceLineNumber>
<PreContext>
{{ error.pre_context }}
</PreContext>
<PostContext>
{{ error.post_context }}
</PostContext>
</Error>
{% endfor %}
<EndBuildTime>
{{ build.endtime }}
</EndBuildTime>
<ElapsedMinutes>
0
</ElapsedMinutes>
</Build>
</Site>
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