diff --git a/fuelweb_test/testrail/builds.py b/fuelweb_test/testrail/builds.py index 9d8d547a4..103de7768 100644 --- a/fuelweb_test/testrail/builds.py +++ b/fuelweb_test/testrail/builds.py @@ -100,7 +100,7 @@ class Build(object): job_url = "/".join([JENKINS["url"], 'job', self.name, str(self.number), 'consoleText']) logger.debug("Request job console from {}".format(job_url)) - return requests.get(job_url).text.split('\n') + return requests.get(job_url).text def get_build_data(self, depth=1): build_url = "/".join([JENKINS["url"], 'job', diff --git a/fuelweb_test/testrail/upload_cases_description.py b/fuelweb_test/testrail/upload_cases_description.py index 0b64946de..5b50d4b91 100644 --- a/fuelweb_test/testrail/upload_cases_description.py +++ b/fuelweb_test/testrail/upload_cases_description.py @@ -40,6 +40,7 @@ GROUP_FIELD = 'custom_test_group' STEP_NUM_PATTERN = re.compile(r'^(\d{1,3})[.].+') DURATION_PATTERN = re.compile(r'Duration:?\s+(\d+(?:[sm]|\s?m))(?:in)?\b') +TEST_GROUP_PATTERN = re.compile(r'run_system_test.py\s+.*--group=(\S+)\b') def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, @@ -162,10 +163,8 @@ def get_tests_groups_from_jenkins(runner_name, build_number, distros): # Get the test group from the console of the job z = Build(b['jobName'], b['buildNumber']) console = z.get_job_console() - groups = [keyword.split('=')[1] - for line in console - for keyword in line.split() - if 'run_system_test.py' in line and '--group=' in keyword] + groups = re.findall(TEST_GROUP_PATTERN, console) + if not groups: logger.error("No test group found in console of the job {0}/{1}" .format(b['jobName'], b['buildNumber']))