CI: Validate mark log

pull/135/head
Luigi311 2024-01-02 18:10:56 -07:00
parent a2b802a5de
commit 4e25ae5539
2 changed files with 36 additions and 0 deletions

View File

@ -59,6 +59,7 @@ jobs:
python main.py
cat mark.log
python test/validate_ci_marklog.py
docker:
runs-on: ubuntu-latest

View 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()