Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
7cf45278
Commit
7cf45278
authored
6 years ago
by
Steffen Hauf
Browse files
Options
Downloads
Patches
Plain Diff
Adjust listing format of test reports
parent
0862fccd
No related branches found
No related tags found
1 merge request
!35
Feat/reproducibility
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/source/conf.py
+28
-17
28 additions, 17 deletions
docs/source/conf.py
docs/source/test_results.rst
+0
-14
0 additions, 14 deletions
docs/source/test_results.rst
with
28 additions
and
31 deletions
docs/source/conf.py
+
28
−
17
View file @
7cf45278
...
...
@@ -440,6 +440,7 @@ with open("available_notebooks.rst", "w") as f:
# add test results
test_artifact_dir
=
os
.
path
.
realpath
(
"
../../tests/artifacts
"
)
from
datetime
import
datetime
from
dateutil.parser
import
parse
from
lxml
import
etree
import
tabulate
...
...
@@ -448,8 +449,7 @@ import textwrap
def
xml_to_rst_report
(
xml
,
git_tag
):
e
=
etree
.
fromstring
(
xml
.
encode
())
rst
=
[
"
.. include:: roles.rst
"
]
rst
+=
[
""
]
rst
=
[
""
]
rst
+=
[
"
Test execution for {test_name} on {ex_date}
"
]
test_name
,
ex_date
=
e
.
get
(
"
name
"
).
split
(
"
-
"
)
ex_date
=
parse
(
ex_date
)
...
...
@@ -522,18 +522,26 @@ def xml_to_rst_report(xml, git_tag):
rst
+=
textwrap
.
indent
(
report
,
"
"
*
4
).
split
(
"
\n
"
)
rst
+=
[
""
]
# console output
rst
+=
[
"
Console Output
"
]
rst
+=
[
"
-
"
*
len
(
rst
[
-
1
])]
rst
+=
[
""
]
do_console
=
False
for
child
in
e
:
if
child
.
tag
!=
"
system-out
"
:
continue
rst
+=
[
"
.. code-block:: console
"
]
rst
+=
textwrap
.
indent
(
child
.
text
,
"
"
*
4
).
split
(
"
\n
"
)
if
child
.
tag
==
"
system-out
"
and
len
(
child
.
text
.
strip
()):
do_console
=
True
break
if
do_console
:
# console output
rst
+=
[
"
Console Output
"
]
rst
+=
[
"
-
"
*
len
(
rst
[
-
1
])]
rst
+=
[
""
]
for
child
in
e
:
if
child
.
tag
!=
"
system-out
"
:
continue
rst
+=
[
"
.. code-block:: console
"
]
rst
+=
textwrap
.
indent
(
child
.
text
,
"
"
*
4
).
split
(
"
\n
"
)
return
"
\n
"
.
join
(
rst
)
...
...
@@ -542,7 +550,8 @@ def sorted_dir(folder):
path
=
os
.
path
.
join
(
folder
,
name
)
return
os
.
path
.
getmtime
(
path
)
return
sorted
(
os
.
listdir
(
folder
),
key
=
getmtime
,
reverse
=
True
)
sort
=
sorted
(
os
.
listdir
(
folder
),
key
=
getmtime
,
reverse
=
True
)
return
[(
s
,
datetime
.
fromtimestamp
(
getmtime
(
s
)))
for
s
in
sort
]
header
=
"""
Test Results
...
...
@@ -562,10 +571,12 @@ if not os.path.exists("./test_rsts"):
with
open
(
"
test_results.rst
"
,
"
w
"
)
as
f
:
f
.
write
(
header
)
for
commit
in
sorted_dir
(
test_artifact_dir
):
for
commit
,
modtime
in
sorted_dir
(
test_artifact_dir
):
with
open
(
"
./test_rsts/{}.rst
"
.
format
(
commit
),
"
w
"
)
as
fr
:
rst
=
[
commit
]
rst
+=
[
"
+
"
*
len
(
commit
)]
rst
=
[
"
.. include:: roles.rst
"
]
rst
+=
[
""
]
rst
+=
[
"
{} - {}
"
.
format
(
commit
[:
8
],
modtime
)]
rst
+=
[
"
+
"
*
len
(
rst
[
-
1
])]
rst
+=
[
""
]
fr
.
write
(
"
\n
"
.
join
(
rst
))
...
...
This diff is collapsed.
Click to expand it.
docs/source/test_results.rst
deleted
100644 → 0
+
0
−
14
View file @
0862fccd
Test Results
************
Results are organized by git commit, and sorted descending by date.
Contents:
.. toctree::
:maxdepth: 2
test_rsts/4962d288a1d6e6b6054fc5440c39ac77e5df5a14
test_rsts/91ae7b03d948c11c75b80e5ffdc71e326c7591be
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