Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
1be85737
Commit
1be85737
authored
Sep 08, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
record_results.py: use the same database file regardless of the changeset
parent
95940bac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
greentest/record_results.py
greentest/record_results.py
+12
-10
No files found.
greentest/record_results.py
View file @
1be85737
...
...
@@ -27,6 +27,7 @@ Usage: %prog program [args]
import
sys
import
os
import
codecs
from
os.path
import
abspath
,
dirname
,
join
,
split
try
:
import
sqlite3
except
ImportError
:
...
...
@@ -36,12 +37,17 @@ from greentest import disabled_marker
warnings
.
simplefilter
(
'ignore'
)
PYTHON_VERSION
=
'%s.%s.%s'
%
sys
.
version_info
[:
3
]
COMMAND_CHANGESET
=
r"hg log -r tip 2> /dev/null | grep changeset"
def
get_results_db
():
path
=
join
(
join
(
*
split
(
dirname
(
abspath
(
__file__
)))[:
-
1
]),
'testresults'
)
try
:
os
.
makedirs
(
path
)
except
OSError
:
pass
return
join
(
path
,
'results.db'
)
def
record
(
changeset
,
argv
,
stdout
,
returncode
):
c
=
sqlite3
.
connect
(
'results.%s_%s.db'
%
(
changeset
,
PYTHON_VERSION
))
def
record
(
argv
,
stdout
,
returncode
):
path
=
get_results_db
()
c
=
sqlite3
.
connect
(
path
)
c
.
execute
(
'''create table if not exists command_record
(id integer primary key autoincrement,
command text,
...
...
@@ -58,10 +64,6 @@ def main():
del
argv
[
0
]
else
:
debug
=
False
try
:
changeset
=
os
.
popen
(
COMMAND_CHANGESET
).
readlines
()[
0
].
replace
(
'changeset:'
,
''
).
strip
().
replace
(
':'
,
'_'
)
except
Exception
:
changeset
=
'revision_unknown'
output_name
=
os
.
tmpnam
()
arg
=
' '
.
join
(
argv
)
+
' &> %s'
%
output_name
print
arg
...
...
@@ -74,7 +76,7 @@ def main():
elif
returncode
==
8
and
disabled_marker
in
stdout
:
pass
else
:
record
(
changeset
,
argv
,
stdout
,
returncode
)
record
(
argv
,
stdout
,
returncode
)
os
.
unlink
(
output_name
)
sys
.
exit
(
returncode
)
...
...
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