Skip to content

Commit a1b03cf

Browse files
committed
Extract pyedaa-reports settings for merged unittesting results.
1 parent 79620e2 commit a1b03cf

5 files changed

+49
-21
lines changed

.github/workflows/CompletePipeline.yml

+2
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,12 @@ jobs:
206206
PublishTestResults:
207207
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev
208208
needs:
209+
- ConfigParams
209210
- UnitTestingParams
210211
- UnitTesting
211212
with:
212213
additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"'
214+
merged_junit_filename: ${{ needs.ConfigParams.outputs.unittest_merged_report_xml_filename }}
213215
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
214216

215217
# VerifyDocs:

.github/workflows/ExtractConfiguration.yml

+30-14
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ on:
6868
unittest_report_xml:
6969
description: ""
7070
value: ${{ jobs.Extract.outputs.unittest_report_xml }}
71+
unittest_merged_report_xml_directory:
72+
description: ""
73+
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml_directory }}
74+
unittest_merged_report_xml_filename:
75+
description: ""
76+
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml_filename }}
77+
unittest_merged_report_xml:
78+
description: ""
79+
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml }}
7180
coverage_report_html_directory:
7281
description: ""
7382
value: ${{ jobs.Extract.outputs.coverage_report_html_directory }}
@@ -95,19 +104,22 @@ jobs:
95104
name: 📓 Extract configurations from pyproject.toml
96105
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
97106
outputs:
98-
package_fullname: ${{ steps.getPackageName.outputs.package_fullname }}
99-
package_directory: ${{ steps.getPackageName.outputs.package_directory }}
100-
mypy_prepare_command: ${{ steps.getPackageName.outputs.mypy_prepare_command }}
101-
unittest_report_xml_directory: ${{ steps.getVariables.outputs.unittest_report_xml_directory }}
102-
unittest_report_xml_filename: ${{ steps.getVariables.outputs.unittest_report_xml_filename }}
103-
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}
104-
coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
105-
coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }}
106-
coverage_report_xml_filename: ${{ steps.getVariables.outputs.coverage_report_xml_filename }}
107-
coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }}
108-
coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }}
109-
coverage_report_json_filename: ${{ steps.getVariables.outputs.coverage_report_json_filename }}
110-
coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }}
107+
package_fullname: ${{ steps.getPackageName.outputs.package_fullname }}
108+
package_directory: ${{ steps.getPackageName.outputs.package_directory }}
109+
mypy_prepare_command: ${{ steps.getPackageName.outputs.mypy_prepare_command }}
110+
unittest_report_xml_directory: ${{ steps.getVariables.outputs.unittest_report_xml_directory }}
111+
unittest_report_xml_filename: ${{ steps.getVariables.outputs.unittest_report_xml_filename }}
112+
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}
113+
unittest_merged_report_xml_directory: ${{ steps.getVariables.outputs.unittest_merged_report_xml_directory }}
114+
unittest_merged_report_xml_filename: ${{ steps.getVariables.outputs.unittest_merged_report_xml_filename }}
115+
unittest_merged_report_xml: ${{ steps.getVariables.outputs.unittest_merged_report_xml }}
116+
coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
117+
coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }}
118+
coverage_report_xml_filename: ${{ steps.getVariables.outputs.coverage_report_xml_filename }}
119+
coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }}
120+
coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }}
121+
coverage_report_json_filename: ${{ steps.getVariables.outputs.coverage_report_json_filename }}
122+
coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }}
111123

112124
steps:
113125
- name: ⏬ Checkout repository
@@ -178,6 +190,7 @@ jobs:
178190
pyProjectSettings = tomli_load(file)
179191
180192
unittestXMLFile = Path(pyProjectSettings["tool"]["pytest"]["junit_xml"])
193+
mergedUnittestXMLFile = Path(pyProjectSettings["tool"]["pyedaa-reports"]["junit_xml"])
181194
coverageHTMLDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"])
182195
coverageXMLFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
183196
coverageJSONFile= Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
@@ -209,6 +222,9 @@ jobs:
209222
unittest_report_xml_directory={unittestXMLFile.parent.as_posix()}
210223
unittest_report_xml_filename={unittestXMLFile.name}
211224
unittest_report_xml={unittestXMLFile.as_posix()}
225+
unittest_merged_report_xml_directory={mergedUnittestXMLFile.parent.as_posix()}
226+
unittest_merged_report_xml_filename={mergedUnittestXMLFile.name}
227+
unittest_merged_report_xml={mergedUnittestXMLFile.as_posix()}
212228
coverage_report_html_directory={coverageHTMLDirectory.as_posix()}
213229
coverage_report_xml_directory={coverageXMLFile.parent.as_posix()}
214230
coverage_report_xml_filename={coverageXMLFile.name}
@@ -218,4 +234,4 @@ jobs:
218234
coverage_report_json={coverageJSONFile.as_posix()}
219235
"""))
220236
221-
print(f"DEBUG:\n unittest xml: {unittestXMLFile}\n coverage html: {coverageHTMLDirectory}\n coverage xml: {coverageXMLFile}\n coverage json: {coverageJSONFile}")
237+
print(f"DEBUG:\n unittest xml: {unittestXMLFile}\n merged unittest xml: {mergedUnittestXMLFile}\n coverage html: {coverageHTMLDirectory}\n coverage xml: {coverageXMLFile}\n coverage json: {coverageJSONFile}")

.github/workflows/PublishTestResults.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ on:
3434
required: false
3535
default: '*-UnitTestReportSummary-XML-*'
3636
type: string
37+
merged_junit_filename:
38+
description: 'Filename of the merged JUnit Test Summary.'
39+
required: false
40+
default: 'Unittesting.xml'
41+
type: string
3742
merged_junit_artifact:
3843
description: 'Name of the merged JUnit Test Summary artifact.'
3944
required: false
@@ -87,23 +92,24 @@ jobs:
8792
8893
- name: 🔁 Merge JUnit Unit Test Summaries
8994
run: |
90-
pyedaa-reports -v unittest "--merge=pyTest-JUnit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=pyTest-JUnit:Unittesting.xml"
91-
printf "%s\n" "cat Unittesting.xml"
92-
cat Unittesting.xml
95+
pyedaa-reports -v unittest "--merge=pyTest-JUnit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=pyTest-JUnit:${{ inputs.merged_junit_filename }}"
96+
printf "%s\n" "cat ${{ inputs.merged_junit_filename }}"
97+
cat ${{ inputs.merged_junit_filename }}
9398
9499
- name: 📊 Publish Unit Test Results
95100
uses: dorny/test-reporter@v1
96101
if: inputs.publish && inputs.report_title != ''
97102
with:
98103
name: ${{ inputs.report_title }}
99-
path: Unittesting.xml
104+
path: ${{ inputs.merged_junit_filename }}
100105
reporter: java-junit
101106

102107
- name: 📤 Upload merged 'JUnit Test Summary' artifact
103108
uses: pyTooling/upload-artifact@v4
104109
if: inputs.merged_junit_artifact != ''
105110
with:
106111
name: ${{ inputs.merged_junit_artifact }}
107-
path: Unittesting.xml
112+
path: ${{ inputs.merged_junit_filename }}
108113
if-no-files-found: error
109114
retention-days: 1
115+
investigate: true

.github/workflows/SphinxDocumentation.yml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
with:
106106
name: ${{ inputs.unittest_xml_artifact }}
107107
path: ${{ inputs.unittest_xml_directory }}
108+
investigate: true
108109

109110
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
110111
uses: pyTooling/download-artifact@v4

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools ~= 76.0",
3+
"setuptools ~= 77.0",
44
"wheel ~= 0.45",
55
"pyTooling ~= 8.3"
66
]
@@ -21,7 +21,10 @@ namespace_packages = true
2121
html_report = "report/typing"
2222

2323
[tool.pytest]
24-
junit_xml = "report/unit/TestReportSummary.xml"
24+
junit_xml = "report/unit/UnittestReportSummary.xml"
25+
26+
[tool.pyedaa-reports]
27+
junit_xml = "report/unit/unittest.xml"
2528

2629
[tool.pytest.ini_options]
2730
addopts = "--tb=native"

0 commit comments

Comments
 (0)