Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make number of tests customizable through .tatt file.

  • Loading branch information...
commit ff242159b618423f25c670067baa826904e8778d 1 parent d424b85
@tom111 authored
View
9 README
@@ -64,3 +64,12 @@ tatt -h
# ignoreprefix contains a list of use flag prefixes to be ignored
# ignoreprefix="elibc_","video_cards_","linguas_","kdeenablefinal","test","debug"
+
+# You can customize the maximal number of rdeps to be tested as follows:
+# rdeps=3
+
+# You can customize the maximal number USE combis to be tested as follows:
+# usecombis=3
+# Note that All USE-flags on and all USE-flags off will always be tested.
+
+
View
4 TODO.org
@@ -43,3 +43,7 @@ Global config object will be pushed around
* TODO Dependency resolution for the commit script
* TODO tinderbox lookup should be arch-specific
* TODO Potential duplicates in revdep sampling. try libpcre for an instance
+* DONE Implement a shorter run for large scale stabilizations (make number of USE combis customizable)
+ CLOSED: [2011-03-11 Fri 13:22]
+ number of rdeps and use flags are now customizable
+* TODO Implement an option to only write a commit script
View
2  tatt/dot-tatt-spec
@@ -5,3 +5,5 @@ template-dir=string(default="/usr/share/tatt/templates/")
unmaskfile=string(default="/etc/portage/package.keywords/archtest")
arch=string(default="x86")
defaultopts=string(default="")
+rdeps=integer(0,50,default=10)
+usecombis=integer(0,64,default=12)
View
2  tatt/scriptwriter.py
@@ -68,7 +68,7 @@ def writerdepscript(job, packlist, config):
# Populate the list of rdeps
rdeps = []
for p in packlist:
- rdeps = rdeps + stablerdeps (p)
+ rdeps = rdeps + stablerdeps (p, config)
if len(rdeps) == 0:
print("No stable rdeps for " + job)
return
View
18 tatt/tinderbox.py
@@ -13,7 +13,7 @@
## Pass the config on to this function:
## Generate stable rdeps ###
-def stablerdeps (package):
+def stablerdeps (package, config):
"""
Find packages with stable versions which depend on atom
We query the tinderbox at http://tinderbox.dev.gentoo.org/misc/dindex/
@@ -61,14 +61,14 @@ def stablerdeps (package):
d[gP(s[0]).packageCatName()] = s[1]
outlist2 = [[k, d[k]] for k in list(d.keys())]
outlist = []
- # outlist2 is set up at this point. To cut it down we sample randomly
- # without replacement until the list is empty or we have 20.
-
+ # outlist2 is set up at this point. It contains all candidates. To cut it down we sample
+ # randomly without replacement until the list is empty or we have config['rdeps'] many.
+
# We are calling eix for each package to work around issues with --stable:
- # What we should do with a future version of eix is to do this in a single run!
- # Todo: Fork multiple eix instances
+ # What we should do with a future version of eix is to do this in a single run
+ # or fork multiple eix instances
- while ((len (outlist2) > 0) and (len(outlist) < 20)):
+ while ((len (outlist2) > 0) and (len(outlist) < config['rdeps'])):
# Warning: sample returns a list, even if only one sample
[samp]=random.sample(outlist2, 1)
# Drop the one we selected
@@ -79,8 +79,8 @@ def stablerdeps (package):
if out == '': continue
else : outlist.append(samp)
- if len(outlist) > 19:
- print("More than 20 stable rdeps, sampled 20. \n")
+ if len(outlist) > config['rdeps']:
+ print("More than " + config['rdeps'] + " stable rdeps, took a sample. \n")
return outlist
#############################
View
13 tatt/usecombis.py
@@ -2,6 +2,7 @@
import random
import re
+import math
from subprocess import *
from .tool import unique
@@ -21,17 +22,21 @@ def findUseFlagCombis (package, config):
for i in config['ignoreprefix']:
uselist=[u for u in uselist if not re.match(i,u)]
- if len(uselist) > 4:
- # More than 4 use flags, generate 16 random strings and everything -, everything +
+ if config['usecombis'] == 0:
+ # Do only all and nothing:
+ swlist = [0,2**(len(uselist))-1]
+ # Test if we can exhaust all USE-combis by computing the binary logarithm.
+ elif len(uselist) > math.log(config['usecombis'],2):
+ # Generate a sample of USE combis
s = 2**(len (uselist))
random.seed()
- swlist = [random.randint(0, s-1) for i in range (16)]
+ swlist = [random.randint(0, s-1) for i in range (config['usecombis'])]
swlist.append(0)
swlist.append(s-1)
swlist.sort()
swlist = unique(swlist)
else:
- # 4 or less use flags. Generate all combinations
+ # Yes we can: generate all combinations
swlist = list(range(2**len(uselist)))
usecombis=[]
Please sign in to comment.
Something went wrong with that request. Please try again.