CI: Validate mark log
This commit is contained in:
35
test/validate_ci_marklog.py
Normal file
35
test/validate_ci_marklog.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# Check the mark.log file that is generated by the CI to make sure it contains the expected values
|
||||
|
||||
import os
|
||||
|
||||
def read_marklog():
|
||||
marklog = os.path.join(os.getcwd(), "mark.log")
|
||||
with open(marklog, "r") as f:
|
||||
lines = f.readlines()
|
||||
return lines
|
||||
|
||||
def check_marklog(lines, expected_values):
|
||||
for line in lines:
|
||||
# Remove the newline character
|
||||
line = line.strip()
|
||||
if line not in expected_values:
|
||||
print("Line not found in marklog: " + line)
|
||||
return False
|
||||
return True
|
||||
|
||||
def main():
|
||||
expected_values = [
|
||||
"jellyplex_watched/TV Shows/Blender Shorts/Episode 2"
|
||||
, "JellyUser/Movies/Big Buck Bunny"
|
||||
, "JellyUser/Shows/Blender Shorts/S01E01"
|
||||
]
|
||||
|
||||
lines = read_marklog()
|
||||
if not check_marklog(lines, expected_values):
|
||||
print("Marklog did not contain the expected values")
|
||||
exit(1)
|
||||
else:
|
||||
print("Marklog contained the expected values")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user