Skip to content

Commit

Permalink
Added event details to image
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorY97 committed Aug 5, 2024
1 parent aadf4b7 commit 554d922
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ bin/
obj/
*.spv
_deps/
scripts/ctestOutput.xml

scripts/discord.json

scripts/output.json

scripts/testimage.png

Testing/Temporary/
# Ignore objects created for local testing
scripts/
# Do not ignore the python script
!/scripts/OutPutResultsToJsons.py
11 changes: 9 additions & 2 deletions scripts/OutPutResultsToJsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def parse_test_results_from_file(file_path):

return test_suite_name, tests, failures, skipped, total_time, test_cases, failed_cases

def create_horizontal_test_results_image(file_path, os, compiler):
def create_horizontal_test_results_image(file_path, os, compiler, event, author, brach):
# Parse the XML data from the file
test_suite_name, tests, failures, skipped, total_time, test_cases, failed_cases = parse_test_results_from_file(file_path)

Expand Down Expand Up @@ -230,6 +230,13 @@ def create_horizontal_test_results_image(file_path, os, compiler):
# Draw title
draw.text((20, 20), "Test Results", font=title_font, fill=white)

x = 200
# Add the trigger details
draw.text((x, 30), f"Author: {author}", font=body_font, fill=white)
x += 150
draw.text((x, 30), f"Event: {event}", font=body_font, fill=white)
x += 150
draw.text((x, 30), f"Branch: {brach}", font=body_font, fill=white)
# Hard set the suite name
test_suite_name = f"{os}-{compiler}"

Expand Down Expand Up @@ -315,7 +322,7 @@ def create_horizontal_test_results_image(file_path, os, compiler):
print(f"Discord JSON output has been written to {discord_json_output_file}")

# Generate data
image = create_horizontal_test_results_image(args.xml_file, args.os, args.compiler)
image = create_horizontal_test_results_image(args.xml_file, args.os, args.compiler, args.event, args.author, args.branch)

# Create the image
os.makedirs(os.path.dirname(args.image_out), exist_ok=True)
Expand Down

0 comments on commit 554d922

Please sign in to comment.