From f7b45fd694d743e735b309d0481d590d7b9d0320 Mon Sep 17 00:00:00 2001 From: chalsliu <45041955+chalsliu@users.noreply.github.com> Date: Mon, 7 Dec 2020 19:27:35 +0800 Subject: [PATCH] Support precision test verification --- tools/get_pr_ut.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/get_pr_ut.py b/tools/get_pr_ut.py index 46c051bdd2..40af40e06f 100644 --- a/tools/get_pr_ut.py +++ b/tools/get_pr_ut.py @@ -37,6 +37,7 @@ class PRChecker(object): self.lineno_prog = re.compile('@@ \-\d+,\d+ \+(\d+),(\d+) @@') self.pr = None self.suffix = '' + self.full_case = False def init(self): """ Get pull request. """ @@ -48,6 +49,17 @@ class PRChecker(object): if suffix: self.suffix = suffix self.pr = self.repo.get_pull(int(pr_id)) + last_commit = None + ix = 0 + while True: + commits = self.pr.get_commits().get_page(ix) + for c in commits: + last_commit = c.commit + else: + break + ix = ix + 1 + if last_commit.message.find('test=full_case') != -1: + self.full_case = True def get_pr_files(self): """ Get files in pull request. """ @@ -156,6 +168,8 @@ class PRChecker(object): def get_pr_ut(self): """ Get unit tests in pull request. """ + if self.full_case: + return '' check_added_ut = False ut_list = [] file_ut_map = None -- GitLab