Skip to content

Commit

Permalink
Support precision test verification
Browse files Browse the repository at this point in the history
  • Loading branch information
chalsliu authored Dec 7, 2020
1 parent ad01658 commit f7b45fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/get_pr_ut.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self):
self.lineno_prog = re.compile('@@ \-\d+,\d+ \+(\d+),(\d+) @@')
self.pr = None
self.suffix = ''
self.full_case = False

def init(self):
""" Get pull request. """
Expand All @@ -48,6 +49,17 @@ def init(self):
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. """
Expand Down Expand Up @@ -156,6 +168,8 @@ def is_only_comment(self, f):

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
Expand Down

0 comments on commit f7b45fd

Please sign in to comment.