Skip to content

Commit 95a992e

Browse files
Tyler Titsworthjitendra42
Tyler Titsworth
andauthored
Improve Merge Logs PR Comment (#448)
Signed-off-by: tylertitsworth <tyler.titsworth@intel.com> Signed-off-by: Tyler Titsworth <tyler.titsworth@intel.com> Co-authored-by: Jitendra Patil <jitendra.patil@intel.com>
1 parent bd9714d commit 95a992e

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.github/workflows/integration-test.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,21 @@ jobs:
103103
- name: Generate TXT file
104104
if: ${{ steps.check_matching_json_files.outputs.has_matching_json_files == 'true' }}
105105
run: |
106-
echo "| Test-Group | Test | Status |" > output.txt
107-
echo "|---------------|-------------|----------|" >> output.txt
108-
jq -r '.[] | "| \(.Group) | \(.Test) | \(.Status) |" ' combined.json >> output.txt
106+
{
107+
echo "### Integration Test Results"
108+
echo "Groups Tested: $(jq -r 'map(.Group) | unique | join(", ")' combined.json)"
109+
echo -e "\n<details>"
110+
echo -e " <summary>Results</summary>\n"
111+
echo " | Test-Group | Test | Status |"
112+
echo " |:----:|:---:|:---:|"
113+
jq -r '.[] | " | \(.Group) | \(.Test) | \(.Status) |"' combined.json
114+
echo -e "\n</details>\n"
115+
if jq -e 'all(.[]; .Status == "PASS")' combined.json > /dev/null; then
116+
echo "#### Overall Result: PASS ✅"
117+
else
118+
echo "#### Overall Result: FAIL ❌"
119+
fi
120+
} >> output.txt
109121
- name: PR-comment
110122
if: ${{ steps.check_matching_json_files.outputs.has_matching_json_files == 'true' }}
111123
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0

test-runner/test_runner.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
148148
rmtree(args.logs_path)
149149
os.makedirs(args.logs_path)
150150
# Set up Logging for test-runner context
151-
unique_identifier = args.logs_path.replace("/", "-")
151+
test_group = os.path.dirname(args.file_path)
152152
logging.basicConfig(
153153
level=logging.INFO,
154154
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
@@ -193,22 +193,20 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
193193
logging.error(err)
194194
summary.append([idx + 1, test.name, "FAIL"])
195195
json_summary.append(
196-
{"Group": unique_identifier, "Test": test.name, "Status": "FAIL"}
196+
{"Group": test_group, "Test": test.name, "Status": "FAIL"}
197197
)
198198
ERROR = True
199199
continue
200200
except KeyboardInterrupt:
201201
summary.append([idx + 1, test.name, "FAIL"])
202202
json_summary.append(
203-
{"Group": unique_identifier, "Test": test.name, "Status": "FAIL"}
203+
{"Group": test_group, "Test": test.name, "Status": "FAIL"}
204204
)
205205
ERROR = True
206206
break
207207
summary.append([idx + 1, test.name, "PASS"])
208-
json_summary.append(
209-
{"Group": unique_identifier, "Test": test.name, "Status": "PASS"}
210-
)
211-
json_summary_path = f"test-runner-summary-{unique_identifier}.json"
208+
json_summary.append({"Group": test_group, "Test": test.name, "Status": "PASS"})
209+
json_summary_path = f"test-runner-summary-{test_group}.json"
212210

213211
with open(json_summary_path, "w", encoding="utf-8") as file:
214212
json.dump(json_summary, file, indent=4)

0 commit comments

Comments
 (0)