Skip to content

Commit

Permalink
contrib/intel/jenkins: Add summary fast forward
Browse files Browse the repository at this point in the history
Fast forwarding the summary to the start of test output.
This will eliminate false positives where a user could put
a keyword in their title to get the summary to think its
something to pay attention to when it actually is just the title.

Signed-off-by: Zach Dworkin <[email protected]>
  • Loading branch information
zachdworkin committed Sep 18, 2023
1 parent c6780d2 commit 91e36c0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
2 changes: 2 additions & 0 deletions contrib/intel/jenkins/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@ def run(self):
default_enable_list = [
'ze-dlopen'
]

cloudbees_log_start_string = "Begin Cloudbees Test Output"
2 changes: 2 additions & 0 deletions contrib/intel/jenkins/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __call__(self, parser, namespace, values, option_string=None):
hosts.append(host)
print(f"hosts = {hosts}")

print(common.cloudbees_log_start_string)

#this script is executed from /tmp
#this is done since some mpi tests
#look for a valid location before running
Expand Down
57 changes: 34 additions & 23 deletions contrib/intel/jenkins/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def __subclasshook__(cls, subclass):
and callable(subclass.check_fail)
and hasattr(subclass, "check_exclude")
and callable(subclass.check_exclude)
and hasattr(subclass, "fast_forward")
and callable(subclass.fast_forward)
and hasattr(subclass, "read_file")
and callable(subclass.read_file)
and hasattr(subclass, "run")
Expand Down Expand Up @@ -221,15 +223,23 @@ def check_line(self, line):
self.check_fail(line)
self.check_exclude(line)

def read_file(self):
def fast_forward(self, log_file):
previous = ""
line = log_file.readline().lower()
while line != "":
self.check_node(line)
self.check_features(previous, line)
if common.cloudbees_log_start_string.lower() in line:
break

previous = line
line = log_file.readline().lower()

def read_file(self):
with open(self.file_path, 'r') as log_file:
self.fast_forward(log_file)
for line in log_file:
line = line.lower()
self.check_features(previous, line)
self.check_node(line)
self.check_line(line)
previous = line
self.check_line(line.lower())

def summarize(self):
if not self.exists:
Expand Down Expand Up @@ -512,14 +522,10 @@ def check_line(self, line, log_file):
self.check_fails(line)

def read_file(self):
previous = ""
with open(self.file_path, 'r') as log_file:
super().fast_forward(log_file)
for line in log_file:
line = line.lower()
super().check_features(previous, line)
super().check_node(line)
self.check_line(line, log_file)
previous = line
self.check_line(line.lower(), log_file)

for key in self.shmem_type.keys():
self.passes += self.shmem_type[key]['passes']
Expand All @@ -533,14 +539,10 @@ def __init__(self, logger, log_dir, prov, mpi, file_name, stage_name):
self.run = 'mpiexec'

def read_file(self):
previous = ""
with open(self.file_path,'r') as log_file:
super().fast_forward(log_file)
for line in log_file:
line = line.lower().strip()
super().check_features(previous, line)
super().check_node(line)
super().check_line(line)
previous = line
super().check_line(line.lower().strip())

def check_exclude(self, line):
if line.startswith('excluding:'):
Expand Down Expand Up @@ -746,16 +748,25 @@ def check_fail(self, line):
self.fails += 1
self.failed_tests.append(self.test_name)

def read_file(self):
def fast_forward(self, log_file):
previous = ""
line = log_file.readline()
while line != "":
self.check_num_node(line)
self.check_node(line.lower())
self.check_features(previous.lower(), line.lower())
if common.cloudbees_log_start_string.lower() in line.lower():
break

previous = line
line = log_file.readline()

def read_file(self):
with open(self.file_path, 'r') as log_file:
self.fast_forward(log_file)
for line in log_file:
super().check_features(previous.lower(), line.lower())
super().check_node(line.lower())
self.check_type(line)
self.check_num_node(line)
self.check_line(line)
previous = line

def get_release_num(log_dir):
file_name = f'{log_dir}/release_num.txt'
Expand Down

0 comments on commit 91e36c0

Please sign in to comment.