Skip to content

Commit 0efd2c5

Browse files
committed
[GR-14284] Fix: propagate status code of pkgtest.
PullRequest: fastr/1939
2 parents 56c43e0 + b23c22f commit 0efd2c5

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

com.oracle.truffle.r.test.packages/pkgtest/__init__.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,12 +657,24 @@ def installpkgs(args, **kwargs):
657657

658658

659659
def pkgtest_cmp(args):
660-
with open(args[0]) as f:
660+
gnur_filename = args[0]
661+
fastr_filename = args[1]
662+
if len(args) >= 4:
663+
test_output_filters = args[2]
664+
pkg_name = args[3]
665+
else:
666+
test_output_filters = None
667+
pkg_name = None
668+
dump_preprocessed = args[4] if len(args) >= 5 else None
669+
670+
filters = select_filters_for_package(args[2], pkg_name) if len(args) >= 3 else None
671+
672+
with open(gnur_filename) as f:
661673
gnur_content = f.readlines()
662-
with open(args[1]) as f:
674+
with open(fastr_filename) as f:
663675
fastr_content = f.readlines()
664676
from fuzzy_compare import fuzzy_compare
665-
return fuzzy_compare(gnur_content, fastr_content, args[0], args[1])
677+
return fuzzy_compare(gnur_content, fastr_content, gnur_filename, fastr_filename, filters, dump_preprocessed)
666678

667679

668680
def find_top100(args):

com.oracle.truffle.r.test.packages/test.output.filter

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
# normalize environment addresses
4545
.* => s/<environment: 0x[0-9A-Fa-f]*>/<environment: 0xCAFEBABE>
4646

47+
# ignore warnings for invalid source references
48+
.* => D/Warning messages:
49+
.* => D+0-1/Invalid source reference
50+
4751
# for individual packages:
4852

4953
# ------
@@ -87,7 +91,8 @@ ROCR => D/detaching ‘ROCR.hiv’
8791
# quantmod: PDF device not supported in saveChart()
8892
quantmod => D-2/ PDF device not supported.
8993
quantmod => D/ incomplete final line found
90-
quantmod => s/There were [0-9]+ warnings \(use warnings\(\) to see them\)/
94+
quantmod => s/There were [0-9]* or more warnings \(use warnings\(\) to see the first [0-9]*\)/
95+
quantmod => D+1-1/In read.table(file = file, header = header, sep = sep, quote = quote, :
9196

9297
# --------
9398
sqldf => D/A svUnit test suite run in
@@ -111,3 +116,12 @@ clpAPI => D/Clp0006I 1 Obj 3.2368421
111116
clpAPI => D/Clp0000I Optimal - objective value 3.2368421
112117
clpAPI => D/Coin0511I After Postsolve, objective 3.2368421, infeasibilities - dual 0 (0), primal 0 (0)
113118
clpAPI => D/Clp0032I Optimal objective 3.236842105 - 1 iterations time
119+
120+
# --------
121+
# RcppBDT
122+
RcppBDT => s/code for methods in class .* was not checked for suspicious field assignments \(recommended package ‘codetools’ not available\?\)/
123+
124+
# --------
125+
# sqldf
126+
sqldf => s/There were [0-9]* or more warnings \(use warnings\(\) to see the first [0-9]*\)/
127+

mx.fastr/mx_fastr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,25 +645,25 @@ def _pkgtest_args(args):
645645
def pkgtest(args, **kwargs):
646646
full_args = _pkgtest_args(args)
647647
mx.logv(["pkgtest"] + full_args)
648-
pkgtest_load().pkgtest(full_args)
648+
return pkgtest_load().pkgtest(full_args)
649649

650650

651651
def installpkgs(args, **kwargs):
652652
full_args = _pkgtest_args(args)
653653
mx.logv(["installpkgs"] + full_args)
654-
pkgtest_load().installpkgs(full_args)
654+
return pkgtest_load().installpkgs(full_args)
655655

656656

657657
def find_top100(*args, **kwargs):
658658
full_args = _pkgtest_args(args) + ["100"]
659659
mx.logv(["find_top"] + full_args)
660-
pkgtest_load().find_top(full_args)
660+
return pkgtest_load().find_top(full_args)
661661

662662

663663
def find_top(*args, **kwargs):
664664
full_args = _pkgtest_args(args)
665665
mx.logv(["find_top"] + full_args)
666-
pkgtest_load().find_top(args)
666+
return pkgtest_load().find_top(args)
667667

668668

669669
def r_pkgtest_analyze(args, **kwargs):

0 commit comments

Comments
 (0)