Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Julien Lopez
QueryR
Commits
7968e99e
Commit
7968e99e
authored
8 years ago
by
Mick Jordan
Browse files
Options
Downloads
Patches
Plain Diff
pkgtest: more robust error handling on test outputs
parent
d3ce382f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mx.fastr/mx_fastr_pkgs.py
+21
-9
21 additions, 9 deletions
mx.fastr/mx_fastr_pkgs.py
with
21 additions
and
9 deletions
mx.fastr/mx_fastr_pkgs.py
+
21
−
9
View file @
7968e99e
...
...
@@ -269,26 +269,37 @@ def _set_test_status(fastr_test_info):
gnur_outputs
=
gnur_test_status
.
testfile_outputs
fastr_outputs
=
fastr_test_status
.
testfile_outputs
if
_failed_outputs
(
gnur_outputs
):
# What this likely means is that some native package is not
# installed on the system so GNUR can't run the tests.
# Ideally this never happens.
print
"
{0}: GnuR test had .fail outputs
"
.
format
(
pkg
)
continue
if
_failed_outputs
(
fastr_outputs
):
# In addition to the similar comment for GNU R, this can happen
# if, say, the JVM crashes (possible with native code packages)
print
"
{0}: FastR test had .fail outputs
"
.
format
(
pkg
)
fastr_test_status
.
status
=
"
FAILED
"
continue
# Now for each successful GNU R output we compare content (assuming FastR didn't fail)
for
gnur_test_output_relpath
,
gnur_testfile_status
in
gnur_outputs
.
iteritems
():
# Can't compare if either GNUR or FastR failed
if
gnur_testfile_status
.
status
==
"
FAILED
"
:
break
if
not
gnur_test_output_relpath
in
fastr_outputs
:
# FastR crashed on this test
fastr_test_status
.
status
=
"
FAILED
"
print
"
{0}: FastR is missing output file: {1}
"
.
format
(
pkg
,
gnur_test_output_relpath
)
break
fastr_testfile_status
=
fastr_outputs
[
gnur_test_output_relpath
]
if
fastr_testfile_status
.
status
==
"
FAILED
"
:
break
gnur_content
=
None
with
open
(
gnur_testfile_status
.
abspath
)
as
f
:
gnur_content
=
f
.
readlines
()
fastr_content
=
None
fastr_testfile_status
=
fastr_outputs
[
gnur_test_output_relpath
]
with
open
(
fastr_testfile_status
.
abspath
)
as
f
:
fastr_content
=
f
.
readlines
()
...
...
@@ -306,13 +317,14 @@ def _set_test_status(fastr_test_info):
if
not
(
fastr_test_status
.
status
==
"
INDETERMINATE
"
or
fastr_test_status
.
status
==
"
FAILED
"
):
fastr_test_status
.
status
=
"
OK
"
# write out a file with the test status for each output
# write out a file with the test status for each output
(that exists)
with
open
(
join
(
_pkg_testdir
(
'
fastr
'
,
pkg
),
'
testfile_status
'
),
'
w
'
)
as
f
:
for
fastr_relpath
,
fastr_testfile_status
in
fastr_outputs
.
iteritems
():
f
.
write
(
fastr_relpath
)
f
.
write
(
'
'
)
f
.
write
(
fastr_testfile_status
.
status
)
f
.
write
(
'
\n
'
)
if
os
.
path
.
exists
(
join
(
_pkg_testdir
(
'
fastr
'
,
pkg
),
fastr_relpath
)):
f
.
write
(
fastr_relpath
)
f
.
write
(
'
'
)
f
.
write
(
fastr_testfile_status
.
status
)
f
.
write
(
'
\n
'
)
print
'
END checking
'
+
pkg
...
...
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