Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite
Commits
258ca0c7
Commit
258ca0c7
authored
May 23, 2011
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps: add logic for batch sequencing
parent
15acd7e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
tps.py
tps.py
+33
-3
No files found.
tps.py
View file @
258ca0c7
...
...
@@ -7,6 +7,7 @@ import glob
import
re
import
os
,
os
.
path
import
datetime
import
random
from
ConfigParser
import
ConfigParser
from
optparse
import
OptionParser
...
...
@@ -85,6 +86,28 @@ class Suite(object):
with
open
(
self
.
config
,
'wb'
)
as
configfile
:
config
.
write
(
configfile
)
def
compute_run
(
self
):
if
not
self
.
sequence
:
raise
TpsNoBatch
if
not
self
.
repeat
:
repeat
=
1
else
:
repeat
=
int
(
self
.
repeat
)
run
=
[]
for
testno
in
self
.
sequence
:
test_glob
=
os
.
path
.
join
(
self
.
test_path
,
'test'
+
testno
+
'.py'
)
files
=
glob
.
glob
(
test_glob
)
if
not
files
:
print
files
,
test_glob
raise
TpsBadTestNo
(
'no test number [
%
s], aborting'
%
testno
)
run
.
append
(
files
[
0
])
if
self
.
randomize
:
random
.
shuffle
(
run
)
return
repeat
*
run
def
run
(
self
):
ts
=
timestamp
()
missing
=
self
.
missing
()
...
...
@@ -99,8 +122,7 @@ class Suite(object):
logfilename
=
self
.
log_name
.
format
(
self
.
board
,
self
.
serial
,
ts
,
runid
)
logfilename
=
os
.
path
.
join
(
self
.
log_path
,
logfilename
)
log
=
file
(
logfilename
,
'wb'
)
test_glob
=
os
.
path
.
join
(
self
.
test_path
,
default_test_pattern
+
'.py'
)
sequence
=
glob
.
glob
(
test_glob
)
sequence
=
self
.
compute_run
()
if
self
.
test_path
not
in
sys
.
path
:
sys
.
path
.
append
(
self
.
test_path
)
...
...
@@ -299,7 +321,15 @@ def main1():
s
=
Cli
(
options
.
config
)
s
.
__dict__
.
update
(
options
.
__dict__
)
s
.
sequence
=
args
s
.
sequence
=
valid
if
not
s
.
repeat
:
s
.
repeat
=
1
else
:
try
:
s
.
repeat
=
int
(
options
.
repeat
)
except
ValueError
:
print
'repeat value must be an int: [
%
s]'
%
options
.
repeat
return
if
options
.
cli
:
s
.
cmdloop
()
...
...
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