From 1ffef098161b9ae219d4700b522bda882c357f5c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 23 Mar 2024 08:50:18 +0100 Subject: [PATCH 1/2] feat: handle parent release in generated documentation --- doc/analysis/generaterobotdata.py | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 1e7e04db..5ed8685d 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -121,6 +121,38 @@ class GenerateRobotData: # Generate the initial_condition of the test suite self.test_suite['initial_condition'] = self.generate_initial_condition() + # Generate the parent release and correct the reference in case that the tags include information since_v1.x.y + self.get_version() + + def get_version(self): + data = [x['tags'] for x in self.test_suite['test_cases']] + aux = [item for sublist in data for item in sublist if item.startswith('since')] + + if len(aux) == 0: + has_since = False + else: + has_since = True + + are_all_same = all(item == aux[0] for item in aux) + + if are_all_same and has_since: + aux = aux[0] + aux = aux.split('since_')[1] + else: + if has_since: + print('Error not all the tags have the same version. Select default v1.3.1') + + aux = 'v1.3.1' + + if 'clauses' in self.test_suite['reference']: + self.test_suite['reference'] = \ + f"ETSI GS CIM 009 V{aux.split('v')[1]} [], clauses {self.test_suite['reference'].split('clauses ')[1]}" + else: + self.test_suite['reference'] = \ + f"ETSI GS CIM 009 V{aux.split('v')[1]} [], clause {self.test_suite['reference'].split('clause ')[1]}" + + self.test_suite['parent_release'] = aux + def generate_initial_condition(self) -> str: aux = [x['setup'] for x in self.test_cases] if all(element == aux[0] for element in aux[1:]): -- GitLab From 1f6ccaf0bb7c1e8c36ab7874f6c310cac4094c24 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 23 Mar 2024 08:51:31 +0100 Subject: [PATCH 2/2] fix: target master in base URL of forge --- doc/statisticsDocumentationData.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index 06af1444..71b72fe5 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -13,7 +13,7 @@ if __name__ == "__main__": number_of_all_testcases = 0 number_of_successes = 0 ROBOT_FILE_EXTENSION = ".robot" - BASE_URL_OF_FORGE = "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/blob/tests-up-to-1_5/TP/NGSI-LD/" + BASE_URL_OF_FORGE = "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/blob/master/TP/NGSI-LD/" fullpath = basedir + "/TP/NGSI-LD" for root, dirs, files in walk(fullpath): @@ -35,7 +35,7 @@ if __name__ == "__main__": else: statistics[name_of_test_case]["failed"] = False number_of_successes += 1 - # we add it here because Fernando's code does not, in case of successfull parsing + # we add it here because Fernando's code does not, in case of successful parsing json_of_test_case["error_while_parsing"] = False # establish the right configuration if json_of_test_case["robotpath"].startswith("ContextSource"): -- GitLab