Commit a85fdf6e authored by Giuseppe Tropea's avatar Giuseppe Tropea
Browse files

code for parsing the correct parent_release tag

parent bbbbac07
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -44,6 +44,21 @@ if __name__ == "__main__":
                        json_of_test_case["config_id"] = "CF_01"
                    # upgrade the version and add the reference in square brackets
                    json_of_test_case["reference"] = re.sub(r"V1.3.1 \[\]", "V1.5.1 [1]", json_of_test_case["reference"])
                    # now for each permutation inside this test case, create the permutation's correct parent_release
                    if "test_cases" in json_of_test_case:
                        # grab everything that is a permutation_body inside the "sub" test_cases,
                        for permutation_body in json_of_test_case["test_cases"]:
                            # default parent release
                            parent_release = "v1.3.1"
                            for tag in permutation_body["tags"]:
                                if tag.startswith('since_'):
                                    parts = tag.split('_')
                                    # the suffix
                                    parent_release = parts[-1]
                            permutation_body["permutation_parent_release"] = parent_release
                    else:
                        print("NO PERMUTATIONS in TESTCASE??? " + json_of_test_case["tp_id"])
                        exit(1)
                testcases.append(json_of_test_case)

    print()