Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
neoppod
Commits
be3c276b
Commit
be3c276b
authored
Sep 09, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test_bot after migration to Git
parent
d53cf5d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
tools/test_bot
tools/test_bot
+28
-9
No files found.
tools/test_bot
View file @
be3c276b
#!/usr/bin/python
import
os
,
subprocess
,
sys
,
time
import
pysvn
def
clean
():
for
path
,
dir_list
,
file_list
in
os
.
walk
(
'.'
):
...
...
@@ -9,6 +8,26 @@ def clean():
if
file
[
-
4
:]
in
(
'.pyc'
,
'.pyo'
):
os
.
remove
(
os
.
path
.
join
(
path
,
file
))
class
GitError
(
EnvironmentError
):
def
__init__
(
self
,
err
,
out
,
returncode
):
EnvironmentError
.
__init__
(
self
,
err
)
self
.
stdout
=
out
self
.
returncode
=
returncode
def
_git
(
*
args
,
**
kw
):
p
=
subprocess
.
Popen
((
'git'
,)
+
args
,
**
kw
)
out
,
err
=
p
.
communicate
()
if
p
.
returncode
:
raise
GitError
(
err
,
out
,
p
.
returncode
)
return
out
def
git
(
*
args
,
**
kw
):
out
=
_git
(
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
*
args
,
**
kw
)
return
out
.
strip
()
def
getRevision
(
*
path
):
return
git
(
'log'
,
'-1'
,
'--format=%H'
,
'--'
,
*
path
)
def
main
():
if
'LANG'
in
os
.
environ
:
del
os
.
environ
[
'LANG'
]
...
...
@@ -21,10 +40,7 @@ def main():
break
arg_count
+=
'='
in
arg
and
1
or
2
svn
=
pysvn
.
Client
()
def
getRevision
(
path
):
return
svn
.
info
(
path
).
commit_revision
.
number
branch
=
git
(
'rev-parse'
,
'--abbrev-ref'
,
'HEAD'
)
test_bot
=
os
.
path
.
realpath
(
__file__
).
split
(
os
.
getcwd
())[
1
][
1
:]
test_bot_revision
=
getRevision
(
test_bot
)
revision
=
0
...
...
@@ -35,10 +51,11 @@ def main():
delay
=
delay
and
time
.
sleep
(
delay
)
or
1800
old_revision
=
revision
try
:
svn
.
update
(
'.'
)
except
pysvn
.
ClientError
,
e
:
_git
(
'fetch'
)
_git
(
'reset'
,
'--merge'
,
'@{u}'
)
except
GitError
,
e
:
continue
revision
=
getRevision
(
'.'
)
revision
=
getRevision
()
if
revision
==
old_revision
:
continue
if
test_bot_revision
!=
getRevision
(
test_bot
):
...
...
@@ -50,7 +67,9 @@ def main():
bin
=
os
.
path
.
join
(
test_home
,
'bin'
)
if
not
subprocess
.
call
((
os
.
path
.
join
(
bin
,
'buildout'
),
'-v'
),
cwd
=
test_home
):
title
=
'(r%u-%s)'
%
(
revision
,
os
.
path
.
basename
(
test_home
))
title
=
'[%s:%s-g%s:%s]'
%
(
branch
,
git
(
'rev-list'
,
'--topo-order'
,
'--count'
,
revision
),
revision
[:
7
],
os
.
path
.
basename
(
test_home
))
if
tests
:
subprocess
.
call
([
os
.
path
.
join
(
bin
,
'neotestrunner'
),
'-'
+
tests
,
'--title'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment