Skip to content

Commit

Permalink
Patch Merge Logs Pathing (#459)
Browse files Browse the repository at this point in the history
Signed-off-by: tylertitsworth <[email protected]>
  • Loading branch information
Tyler Titsworth authored Oct 17, 2024
1 parent 80e0b2b commit ec27d28
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,23 @@ jobs:
with:
pattern: test-runner-summary*
merge-multiple: true
- name: Check for JSON files
- name: Find Summary
id: summary
shell: bash
run: |
if [[ -n "$(find . -maxdepth 1 -name 'test-runner-summary*.json' -print -quit)" ]]; then
echo "has_matching_json_files=true" >> "$GITHUB_OUTPUT"
SUMMARY=$(find . -maxdepth 3 -name '*summary.json' -print)
if [[ -n "$SUMMARY" ]]; then
echo "summary=$SUMMARY" >> "$GITHUB_OUTPUT"
echo "Files matching the pattern test-runner-summary*.json found in the directory"
summary_dir=$(dirname "$SUMMARY")
jq -s '[.[] | .[]]' $summary_dir/*summary.json > combined.json
echo "Files found in the directory"
else
echo "has_matching_json_files=false" >> "$GITHUB_OUTPUT"
echo "summary=false" >> "$GITHUB_OUTPUT"
echo "No files matching the pattern test-runner-summary*.json found in the directory"
fi
id: check_matching_json_files
- name: Combine JSON files
if: ${{ steps.check_matching_json_files.outputs.has_matching_json_files == 'true' }}
run: |
jq -s '[.[] | .[]]' *.json > combined.json
echo "Files found in the directory"
- name: Generate TXT file
if: ${{ steps.check_matching_json_files.outputs.has_matching_json_files == 'true' }}
if: ${{ steps.summary.outputs.summary != 'false' }}
run: |
{
echo "### Integration Test Results"
Expand All @@ -119,7 +118,7 @@ jobs:
fi
} >> output.txt
- name: PR-comment
if: ${{ steps.check_matching_json_files.outputs.has_matching_json_files == 'true' }}
if: ${{ steps.summary.outputs.summary == 'true' }}
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ logs/
models-perf/
output/
site
test-runner-summary-output.json
venv/
2 changes: 1 addition & 1 deletion test-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ runs:
if: always()
with:
name: test-runner-summary ${{ env.test }}
path: test-runner-summary*.json
path: ${{ inputs.test_dir }}/logs/*summary.json
overwrite: true
2 changes: 1 addition & 1 deletion test-runner/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
break
summary.append([idx + 1, test.name, "PASS"])
json_summary.append({"Group": test_group, "Test": test.name, "Status": "PASS"})
json_summary_path = f"test-runner-summary-{test_group}.json"
json_summary_path = f"{args.logs_path}/{test_group.replace('/', '-')}-summary.json"

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

0 comments on commit ec27d28

Please sign in to comment.