Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Download dashboard script and testing data
run: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${{ env.ExternalDataVersion }}/InsightData-${{ env.ExternalDataVersion }}.tar.gz -O
cmake -E tar xfz InsightData-${{ env.ExternalDataVersion }}.tar.gz
Expand All @@ -174,9 +174,14 @@ jobs:
c++ --version
cmake --version

ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -VV -j ${{ matrix.parallel-level }} ${{ matrix.ctest-options }}
ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -V -j ${{ matrix.parallel-level }} ${{ matrix.ctest-options }}
env:
CTEST_OUTPUT_ON_FAILURE: 1

- name: Report build warnings and errors
if: always()
run: python3 ${{ github.workspace }}/Testing/ContinuousIntegration/report_build_diagnostics.py ${{ github.workspace }}/build

- name: Save compiler cache
if: ${{ !cancelled() }}
uses: actions/cache/save@v5
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesBatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
displayName: 'Install dependencies'

- script: |
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -103,12 +103,16 @@ jobs:
- script: |
cmake --version
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
25 changes: 19 additions & 6 deletions Testing/ContinuousIntegration/AzurePipelinesLinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

- bash: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -111,12 +111,16 @@ jobs:
c++ --version
cmake --version

ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down Expand Up @@ -156,7 +160,7 @@ jobs:

- bash: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -202,12 +206,16 @@ jobs:
c++ --version
cmake --version

ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down Expand Up @@ -249,7 +257,7 @@ jobs:
displayName: "Install dependencies"
- bash: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
cmake -E rename InsightToolkit-$(ExternalDataVersion)/.ExternalData/CID $(Build.SourcesDirectory)/.ExternalData/CID
Expand Down Expand Up @@ -291,11 +299,16 @@ jobs:
set -x
c++ --version
cmake --version
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
displayName: "Build and test"
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- bash: |
set -x

git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -118,12 +118,16 @@ jobs:
c++ --version
cmake --version

ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 -L Python -E "(PythonExtrasTest)|(PythonFastMarching)|(PythonLazyLoadingImage)|(PythonThresholdSegmentationLevelSetWhiteMatterTest)|(PythonVerifyTTypeAPIConsistency)|(PythonWatershedSegmentation1Test)"
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 -L Python -E "(PythonExtrasTest)|(PythonFastMarching)|(PythonLazyLoadingImage)|(PythonThresholdSegmentationLevelSetWhiteMatterTest)|(PythonVerifyTTypeAPIConsistency)|(PythonWatershedSegmentation1Test)"
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesMacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

- bash: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -117,12 +117,16 @@ jobs:
c++ --version
cmake --version

ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 3
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 3
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- bash: |
set -x

git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -126,12 +126,16 @@ jobs:
c++ --version
cmake --version

ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 3
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 3
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
displayName: 'Install dependencies'

- script: |
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -104,12 +104,16 @@ jobs:
- script: |
cmake --version
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
8 changes: 6 additions & 2 deletions Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
displayName: 'Install dependencies'

- script: |
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
git clone -b dash-board-github-ci-instrument-groupings --single-branch https://github.com/hjmjohnson/ITK.git ITK-dashboard

curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
Expand Down Expand Up @@ -114,12 +114,16 @@ jobs:
- script: |
cmake --version
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 2 -L Python
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2 -L Python
displayName: 'Build and test'
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_MAXSIZE: 2.4G

- script: python $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
condition: succeededOrFailed()
displayName: 'Report build warnings and errors'

- script: |
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
condition: succeededOrFailed()
Expand Down
83 changes: 83 additions & 0 deletions Testing/ContinuousIntegration/report_build_diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
"""Extract and print build warnings/errors from CTest Build.xml.

ctest_build() writes compiler diagnostics to Build.xml for CDash but
does not print them to stdout. This script reads Build.xml from the
most recent test run and prints the <Text> content of every <Warning>
and <Error> element so diagnostics appear directly in CI logs.

Usage:
python report_build_diagnostics.py <build-directory>
"""

import os
import sys
import xml.etree.ElementTree as ET


def main():
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <build-directory>", file=sys.stderr)
sys.exit(1)

build_dir = sys.argv[1]

# CTest writes a TAG file whose first line is the timestamp directory.
tag_file = os.path.join(build_dir, "Testing", "TAG")
if not os.path.isfile(tag_file):
print(f"No TAG file found at {tag_file} — skipping.", file=sys.stderr)
return

with open(tag_file) as f:
tag_dir = f.readline().strip()

build_xml = os.path.join(build_dir, "Testing", tag_dir, "Build.xml")
if not os.path.isfile(build_xml):
print(f"No Build.xml found at {build_xml} — skipping.", file=sys.stderr)
return

tree = ET.parse(build_xml)
root = tree.getroot()

# Find all <Warning> and <Error> elements under <Build>.
warnings = []
errors = []
for build_elem in root.iter("Build"):
for warning in build_elem.findall("Warning"):
text = warning.findtext("Text", "").strip()
src = warning.findtext("SourceFile", "").strip()
line = warning.findtext("SourceLineNumber", "").strip()
if text:
warnings.append((src, line, text))
for error in build_elem.findall("Error"):
text = error.findtext("Text", "").strip()
src = error.findtext("SourceFile", "").strip()
line = error.findtext("SourceLineNumber", "").strip()
if text:
errors.append((src, line, text))

if not warnings and not errors:
print("No build warnings or errors found.")
return

if errors:
print(f"========== BUILD ERRORS ({len(errors)}) ==========")
for src, line, text in errors:
print(f" {text}")
print()

if warnings:
print(f"========== BUILD WARNINGS ({len(warnings)}) ==========")
for src, line, text in warnings:
print(f" {text}")
print()

print("====================================================")

# Exit with non-zero status only if there are errors (warnings are
# informational). This lets CI pipelines treat the step as a
# soft-fail for warnings but hard-fail for errors if desired.


if __name__ == "__main__":
main()
Loading