Skip to content

Commit 27adb36

Browse files
[ci] Fix summary in test examples workflow (#3951)
### Changes Modify `.github/scripts/pytest_md_summary.py` to recursive search xml file in target directory instead of glob ### Reason for changes https://github.com/openvinotoolkit/nncf/actions/runs/22205757297 Changed behavior of `actions/download-artifact` since v7.0.0 ### Tests https://github.com/openvinotoolkit/nncf/actions/runs/22402028564/job/64853123212?pr=3951
1 parent 1654ef6 commit 27adb36

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/scripts/pytest_md_summary.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import sys
1313
from dataclasses import dataclass
14-
from glob import glob
14+
from pathlib import Path
1515

1616
from defusedxml import ElementTree as ET
1717

@@ -34,7 +34,7 @@ def __lt__(self, other: object) -> bool:
3434
return self.name < other.name
3535

3636

37-
def parse_xml_report(xml_file) -> list[TestInfo]:
37+
def parse_xml_report(xml_file: Path) -> list[TestInfo]:
3838
"""
3939
Parse the XML report generated by pytest.
4040
@@ -85,18 +85,18 @@ def parse_xml_report(xml_file) -> list[TestInfo]:
8585
if __name__ == "__main__":
8686
"""
8787
This script generates a summary table in Markdown format from XML reports generated by pytest.
88-
Supports multiple XML files and glob patterns.
88+
Finds all XML files recursively in the specified directory.
8989
9090
Usage in GitHub workflow:
9191
- name: Test Summary
9292
if: ${{ !cancelled() }}
9393
run: |
94-
python .github/scripts/pytest_md_summary.py test-results/*/pytest-results.xml >> $GITHUB_STEP_SUMMARY
94+
python .github/scripts/pytest_md_summary.py test-results >> $GITHUB_STEP_SUMMARY
9595
"""
9696
try:
9797
xml_files = []
98-
for pattern in sys.argv[1:]:
99-
xml_files.extend(glob(pattern))
98+
for root in sys.argv[1:]:
99+
xml_files.extend(Path(root).rglob("*.xml"))
100100

101101
if not xml_files:
102102
sys.exit(1)

.github/workflows/conformance_weight_compression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ jobs:
9494
- name: Test Summary
9595
run: |
9696
pip install defusedxml==0.7.1
97-
python .github/scripts/pytest_md_summary.py test-results/*/pytest-results.xml >> "$GITHUB_STEP_SUMMARY"
97+
python .github/scripts/pytest_md_summary.py test-results >> "$GITHUB_STEP_SUMMARY"

.github/workflows/examples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ jobs:
239239
- name: Test Summary
240240
run: |
241241
pip install defusedxml==0.7.1
242-
python .github/scripts/pytest_md_summary.py test-results/*/pytest-results.xml >> "$GITHUB_STEP_SUMMARY"
242+
python .github/scripts/pytest_md_summary.py test-results >> "$GITHUB_STEP_SUMMARY"
243243
244244
examples-cuda-summary:
245245
name: Examples CUDA Summary
@@ -257,7 +257,7 @@ jobs:
257257
- name: Test Summary
258258
run: |
259259
pip install defusedxml==0.7.1
260-
python .github/scripts/pytest_md_summary.py test-results/*/pytest-results.xml >> "$GITHUB_STEP_SUMMARY"
260+
python .github/scripts/pytest_md_summary.py test-results >> "$GITHUB_STEP_SUMMARY"
261261
262262
examples-win-cpu-summary:
263263
name: Examples Windows CPU Summary
@@ -275,4 +275,4 @@ jobs:
275275
- name: Test Summary
276276
run: |
277277
pip install defusedxml==0.7.1
278-
python .github/scripts/pytest_md_summary.py test-results/*/pytest-results.xml >> "$GITHUB_STEP_SUMMARY"
278+
python .github/scripts/pytest_md_summary.py test-results >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)