Skip to content

Commit

Permalink
Making norun_tests env_types combinations robust
Browse files Browse the repository at this point in the history
Earlier, we were looking for only specific permutations of
norun_tests combinations. Now, it is more robust by using
permutations.

Signed-off-by: Narasimhan V <[email protected]>
  • Loading branch information
narasimhan-v committed Apr 21, 2020
1 parent d14a603 commit fa49851
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions avocado-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import argparse
import configparser
import binascii
from itertools import permutations
from shutil import copyfile

from lib.logger import logger_init
Expand Down Expand Up @@ -443,14 +444,18 @@ def parse_test_config(test_config_file, avocado_bin, enable_kvm):
(env_ver, env_type, cmdpat) = helper.get_env_type(enable_kvm)
norun_tests = []
# Get common set of not needed tests
env = 'norun_%s' % env_type
dist = 'norun_%s' % helper.get_dist()[0]
major = 'norun_%s' % env_ver.split('.')[0]
minor = 'norun_%s' % env_ver
minor_env = 'norun_%s_%s' % (env_ver, env_type)
for section in [env, dist, major, minor, minor_env]:
if NORUNTESTFILE.has_section(section):
norun_tests.extend(NORUNTESTFILE.get(section, 'tests').split(','))
dist = helper.get_dist()[0]
major = env_ver.split('.')[0]
minor = env_ver
perm = []
env_list = [env_type, dist, major, minor]
for length in range(1, len(env_list)):
perm.extend(list(permutations(env_list, length)))
perm = ['norun_%s' % '_'.join(per) for per in perm]
for per in perm:
print(per)
if NORUNTESTFILE.has_section(per):
norun_tests.extend(NORUNTESTFILE.get(per, 'tests').split(','))
norun_tests = list(filter(None, norun_tests))

with open(test_config_file, 'r') as fp:
Expand Down

0 comments on commit fa49851

Please sign in to comment.