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
b807ef1f
Commit
b807ef1f
authored
9 years ago
by
Mick Jordan
Browse files
Options
Downloads
Patches
Plain Diff
pkgtest: process install/test output online
parent
4b72486b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ci.hocon
+2
-2
2 additions, 2 deletions
ci.hocon
com.oracle.truffle.r.test.cran/r/install.cran.packages.R
+11
-2
11 additions, 2 deletions
com.oracle.truffle.r.test.cran/r/install.cran.packages.R
mx.fastr/mx_fastr_pkgs.py
+54
-3
54 additions, 3 deletions
mx.fastr/mx_fastr_pkgs.py
with
67 additions
and
7 deletions
ci.hocon
+
2
−
2
View file @
b807ef1f
...
...
@@ -74,6 +74,6 @@ builds = [
${
gateTest
}
{
capabilities
:
[
linux
,
amd
64
,
gate
],
name
:
"gate-test-linux-amd64"
}
${
gateStyle
}
{
capabilities
:
[
linux
,
amd
64
,
gate
],
name
:
"gate-style-linux-amd64"
}
# ${gateTest} {capabilities : [linux, sparcv9, gate], name: "gate-test-linux-sparcv9"}
${
pkgtest
}
{
capabilities
:
[
linux
,
amd
64
,
gate
],
name
:
"pkgtest-test-linux-amd64"
}
${
pkginstall
}
{
capabilities
:
[
linux
,
amd
64
,
gate
],
name
:
"pkginstall-test-linux-amd64"
}
#
${pkgtest} {capabilities : [linux, amd64, gate], name: "pkgtest-test-linux-amd64"}
#
${pkginstall} {capabilities : [linux, amd64, gate], name: "pkginstall-test-linux-amd64"}
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
com.oracle.truffle.r.test.cran/r/install.cran.packages.R
+
11
−
2
View file @
b807ef1f
...
...
@@ -378,7 +378,7 @@ install.pkgs <- function(pkgnames, dependents.install=F) {
install.total
<-
length
(
pkgnames
)
result
<-
TRUE
for
(
pkgname
in
pkgnames
)
{
cat
(
"processing:"
,
pkgname
,
"\n"
)
cat
(
"
BEGIN
processing:"
,
pkgname
,
"\n"
)
dependent.install.ok
<-
T
if
(
install.dependents.first
&&
!
dependents.install
)
{
dependents
<-
install.order
(
avail.pkgs
,
avail.pkgs
[
pkgname
,
])
...
...
@@ -439,6 +439,8 @@ install.pkgs <- function(pkgnames, dependents.install=F) {
}
}
}
cat
(
"END processing:"
,
pkgname
,
"\n"
)
install.count
=
install.count
+
1
}
return
(
result
)
...
...
@@ -489,13 +491,18 @@ do.it <- function() {
cat
(
"END package installation\n"
)
if
(
print.ok.installs
)
{
cat
(
"BEGIN install status\n"
)
for
(
pkgname.i
in
names
(
install.status
))
{
cat
(
paste0
(
pkgname.i
,
":"
),
ifelse
(
install.status
[
pkgname.i
],
"OK"
,
"FAILED"
),
"\n"
)
}
cat
(
"END install status\n"
)
}
}
if
(
run.tests
)
{
if
(
no.install
)
{
check.installed.packages
()
}
cat
(
"BEGIN package tests\n"
)
test.count
=
1
test.total
=
length
(
test.pkgnames
)
...
...
@@ -504,8 +511,10 @@ do.it <- function() {
if
(
dry.run
)
{
cat
(
"would test:"
,
pkgname
,
"\n"
)
}
else
{
cat
(
"testing:"
,
pkgname
,
"("
,
test.count
,
"of"
,
test.total
,
")"
,
"\n"
)
cat
(
"BEGIN testing:"
,
pkgname
,
"("
,
test.count
,
"of"
,
test.total
,
")"
,
"\n"
)
test.package
(
pkgname
)
cat
(
"END testing:"
,
pkgname
,
"\n"
)
}
}
else
{
cat
(
"install failed, not testing:"
,
pkgname
,
"\n"
)
...
...
This diff is collapsed.
Click to expand it.
mx.fastr/mx_fastr_pkgs.py
+
54
−
3
View file @
b807ef1f
...
...
@@ -23,7 +23,8 @@
from
argparse
import
ArgumentParser
from
os.path
import
join
,
abspath
import
shutil
,
os
import
shutil
,
os
,
re
import
mx
import
mx_fastr
def
pkgtest
(
args
):
...
...
@@ -65,12 +66,62 @@ def pkgtest(args):
if
args
.
invert_pkgset
:
install_args
+=
[
'
--invert-pkgset
'
]
class
TestStatus
:
def
__init__
(
self
):
self
.
status
=
"
unknown
"
self
.
filelist
=
[]
class
OutputCapture
:
def
__init__
(
self
):
self
.
data
=
""
self
.
install_data
=
None
self
.
pkg
=
None
self
.
mode
=
None
self
.
start_install_pattern
=
re
.
compile
(
r
"
^BEGIN processing: (?P<package>[a-zA-Z0-9\.\-]+) .*
"
)
self
.
test_pattern
=
re
.
compile
(
r
"
^(?P<status>BEGIN|END) testing: (?P<package>[a-zA-Z0-9\.\-]+) .*
"
)
self
.
status_pattern
=
re
.
compile
(
r
"
^(?P<package>[a-zA-Z0-9\.\-]+): (?P<status>OK|FAILED).*
"
)
self
.
install_data
=
dict
()
self
.
install_status
=
dict
()
self
.
test_info
=
dict
()
def
__call__
(
self
,
data
):
print
data
,
self
.
data
+=
data
if
data
==
"
BEGIN package installation
\n
"
:
self
.
mode
=
"
install
"
return
elif
data
==
"
BEGIN install status
\n
"
:
self
.
mode
=
"
install_status
"
return
elif
data
==
"
BEGIN package tests
\n
"
:
self
.
mode
=
"
test
"
return
if
self
.
mode
==
"
install
"
:
start_install
=
re
.
match
(
self
.
start_install_pattern
,
data
)
if
start_install
:
pkg_name
=
start_install
.
group
(
1
)
self
.
pkg
=
pkg_name
self
.
install_data
[
self
.
pkg
]
=
""
if
self
.
pkg
:
self
.
install_data
[
self
.
pkg
]
+=
data
elif
self
.
mode
==
"
install_status
"
:
if
data
==
"
END install status
\n
"
:
self
.
mode
=
None
return
status
=
re
.
match
(
self
.
status_pattern
,
data
)
pkg_name
=
status
.
group
(
1
)
self
.
install_status
[
pkg_name
]
=
status
.
group
(
2
)
==
"
OK
"
elif
self
.
mode
==
"
test
"
:
test_match
=
re
.
match
(
self
.
test_pattern
,
data
)
if
test_match
:
begin_end
=
test_match
.
group
(
1
)
pkg_name
=
test_match
.
group
(
2
)
if
begin_end
==
"
END
"
:
pkg_testdir
=
join
(
mx
.
suite
(
'
fastr
'
).
dir
,
'
test
'
,
pkg_name
)
for
root
,
_
,
files
in
os
.
walk
(
pkg_testdir
):
if
not
self
.
test_info
.
has_key
(
pkg_name
):
self
.
test_info
[
pkg_name
]
=
TestStatus
()
for
f
in
files
:
self
.
test_info
[
pkg_name
].
filelist
.
append
(
join
(
root
,
f
))
out
=
OutputCapture
()
...
...
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