Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tf-build
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benedikt Wildenhain
tf-build
Commits
43d02ed6
Commit
43d02ed6
authored
Mar 22, 2022
by
Austin Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Fix test splitter for shards
parent
9eb9c4fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tf_sig_build_dockerfiles/devel.usertools/squash_testlogs.py
+9
-2
9 additions, 2 deletions
tf_sig_build_dockerfiles/devel.usertools/squash_testlogs.py
with
9 additions
and
2 deletions
tf_sig_build_dockerfiles/devel.usertools/squash_testlogs.py
+
9
−
2
View file @
43d02ed6
...
@@ -48,7 +48,13 @@ for f in files.strip().splitlines():
...
@@ -48,7 +48,13 @@ for f in files.strip().splitlines():
p
.
getparent
().
remove
(
p
)
p
.
getparent
().
remove
(
p
)
# Remove duplicate results of the same exact test (e.g. due to retry attempts)
# Remove duplicate results of the same exact test (e.g. due to retry attempts)
for
p
in
testsuite
.
_elem
.
xpath
(
'
.//error | .//failure
'
):
for
p
in
testsuite
.
_elem
.
xpath
(
'
.//error | .//failure
'
):
key
=
p
.
getparent
().
get
(
"
name
"
,
""
)
+
p
.
text
# Sharded tests have target names like this:
# WindowOpsTest.test_tflite_convert0 (<function hann_window at 0x7fc61728dd40>, 10, False, tf.float32)
# Where 0x... is a thread ID (or something) that is not important for
# debugging, but breaks this "number of failures" counter because it's
# different for repetitions of the same test. We use re.sub("0x\w+")
# to remove it.
key
=
re
.
sub
(
"
0x\w+
"
,
""
,
p
.
getparent
().
get
(
"
name
"
,
""
))
+
p
.
text
if
key
in
seen
:
if
key
in
seen
:
testsuite
.
_elem
.
remove
(
p
.
getparent
())
testsuite
.
_elem
.
remove
(
p
.
getparent
())
seen
[
key
]
+=
1
seen
[
key
]
+=
1
...
@@ -59,9 +65,10 @@ for f in files.strip().splitlines():
...
@@ -59,9 +65,10 @@ for f in files.strip().splitlines():
result
+=
r
result
+=
r
# Insert the number of failures for each test to help identify flaikes
# Insert the number of failures for each test to help identify flaikes
# need to clarify for shard
for
p
in
result
.
_elem
.
xpath
(
'
.//error | .//failure
'
):
for
p
in
result
.
_elem
.
xpath
(
'
.//error | .//failure
'
):
short_name
=
re
.
search
(
r
'
/(bazel_pip|tensorflow)/.*
'
,
f
.
decode
(
"
utf-8
"
)).
group
(
0
)
short_name
=
re
.
search
(
r
'
/(bazel_pip|tensorflow)/.*
'
,
f
.
decode
(
"
utf-8
"
)).
group
(
0
)
key
=
p
.
getparent
().
get
(
"
name
"
,
""
)
+
p
.
text
key
=
re
.
sub
(
"
0x\w+
"
,
""
,
p
.
getparent
().
get
(
"
name
"
,
""
)
)
+
p
.
text
p
.
text
+=
f
"
\n
NOTE: From /
{
short_name
}
"
p
.
text
+=
f
"
\n
NOTE: From /
{
short_name
}
"
p
.
text
=
runfiles_matcher
.
sub
(
"
[testroot]/
"
,
p
.
text
)
p
.
text
=
runfiles_matcher
.
sub
(
"
[testroot]/
"
,
p
.
text
)
if
"
bazel_pip
"
in
short_name
:
if
"
bazel_pip
"
in
short_name
:
...
...
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