X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Finput_data_parser.py;h=2351942377e06f54214e04f2452441b4f6217932;hb=ea195d1dd99a65736956c9b97e79ba0367b6206b;hp=a04f351cabf681d31a685ef7040bf2372c7628f7;hpb=83d2cc2ccdcbcb4a228168d70101abb3c442fd39;p=csit.git diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index a04f351cab..2351942377 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -854,7 +854,40 @@ class InputData(object): logging.error(" Missing mandatory parameter in the element " "specification.", err) return None + except AttributeError: + return None except SyntaxError: logging.error(" The filter '{0}' is not correct. Check if all " "tags are enclosed by apostrophes.".format(cond)) return None + + @staticmethod + def merge_data(data): + """Merge data from more jobs and builds to a simple data structure. + + The output data structure is: + + - test (suite) 1 ID: + - param 1 + - param 2 + ... + - param n + ... + - test (suite) n ID: + ... + + :param data: Data to merge. + :type data: pandas.Series + :returns: Merged data. + :rtype: pandas.Series + """ + + logging.info(" Merging data ...") + + merged_data = pd.Series() + for _, builds in data.iteritems(): + for _, item in builds.iteritems(): + for ID, item_data in item.iteritems(): + merged_data[ID] = item_data + + return merged_data