Skip to content

Commit

Permalink
Output googletest junit
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Sep 19, 2024
1 parent 2ec2b66 commit fc130a2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
matrix.special && '-' || '',
matrix.special)}}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true # TODO: DELETEME, see #1305
CELER_JUNIT_OUTPUT: "${{github.workspace}}/test-output/"
GTEST_OUTPUT: "xml:${{env.CELER_JUNIT_OUTPUT}}google/"
runs-on: ubuntu-latest
container:
image: >-
Expand Down Expand Up @@ -90,8 +92,8 @@ jobs:
working-directory: build
run: |
ctest --parallel $(nproc) --timeout 180 --output-on-failure \
--output-junit test-results.junit.xml \
--test-output-size-passed=65536 --test-output-size-failed=1048576
--test-output-size-passed=65536 --test-output-size-failed=1048576 \
--output-junit "${{env.CELER_JUNIT_OUTPUT}}ctest/all.xml"
- name: Install Celeritas
working-directory: build
run: |
Expand Down Expand Up @@ -123,7 +125,7 @@ jobs:
|| steps.test.outcome == 'failure'}}
with:
name: test-results-${{matrix.image}}-${{env.CMAKE_PRESET}}
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
CMAKE_PRESET: fast
CC: ${{matrix.compiler}}-${{matrix.version}}
CXX: ${{matrix.compiler == 'gcc' && 'g++' || 'clang++'}}-${{matrix.version}}
CELER_JUNIT_OUTPUT: "${{github.workspace}}\\test-output\\"
GTEST_OUTPUT: "xml:${{env.CELER_JUNIT_OUTPUT}}google\\"
runs-on: >-
${{ matrix.runner == 'focal' && 'ubuntu-20.04'
|| matrix.runner == 'jammy' && 'ubuntu-22.04'
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:
working-directory: build
run: |
ctest --parallel $(nproc) --timeout 15 --output-on-failure \
--output-junit test-results.junit.xml
--output-junit "${{env.CELER_JUNIT_OUTPUT}}ctest/all.xml"
- name: Install
working-directory: build
run: |
Expand All @@ -104,7 +106,7 @@ jobs:
|| steps.test.outcome == 'failure'}}
with:
name: test-results-fast-${{matrix.compiler}}-${{matrix.version}}
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1
windows:
Expand All @@ -115,6 +117,8 @@ jobs:
CCACHE_DIR: "${{github.workspace}}\\.ccache"
CCACHE_MAXSIZE: "100Mi"
CMAKE_PRESET: fast
CELER_JUNIT_OUTPUT: "${{github.workspace}}/test-output/"
GTEST_OUTPUT: "xml:${{env.CELER_JUNIT_OUTPUT}}google/"
runs-on: windows-latest
steps:
- name: Install dependencies
Expand Down Expand Up @@ -167,7 +171,7 @@ jobs:
|| steps.test.outcome == 'failure'}}
with:
name: test-results-fast-windows
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
SPACK_BUILDCACHE: "celer-buildcache" # see spack.yaml
CC: "clang-15"
CXX: "clang++-15"
CELER_JUNIT_OUTPUT: "${{github.workspace}}/test-output/"
GTEST_OUTPUT: "xml:${{env.CELER_JUNIT_OUTPUT}}google/"
runs-on: ubuntu-22.04
continue-on-error: false
steps:
Expand Down Expand Up @@ -151,7 +153,7 @@ jobs:
export CELER_TEST_STRICT=1
fi
ctest --parallel $(nproc) --timeout 15 --output-on-failure \
--output-junit test-results.junit.xml
--output-junit "${{env.CELER_JUNIT_OUTPUT}}ctest/all.xml"
- name: Upload failed tests
if: ${{steps.test.outcome == 'failure'}}
uses: actions/upload-artifact@v4
Expand All @@ -170,7 +172,7 @@ jobs:
|| steps.test.outcome == 'failure')}}
with:
name: test-results-spack-${{env.CMAKE_PRESET}}-${{matrix.geant}}
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1
- name: Check using build directory as install
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/build-ultralite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ concurrency:
group: build-ultralite-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}}
cancel-in-progress: true

# env:
# CCACHE_DEBUG: 1
# CCACHE_DEBUGDIR: ${{github.workspace}}/ccache-debug

jobs:
linux:
name: ultralite-ubuntu
env:
CCACHE_DIR: "${{github.workspace}}/.ccache"
CCACHE_MAXSIZE: "50Mi"
CMAKE_PRESET: ultralite
CELER_JUNIT_OUTPUT: "${{github.workspace}}/test-output/"
runs-on: ubuntu-latest
steps:
- name: Install dependencies
Expand Down Expand Up @@ -54,7 +51,7 @@ jobs:
working-directory: build
run: |
ctest --parallel $(nproc) --timeout 15 --output-on-failure \
--output-junit test-results.junit.xml
--output-junit "${{env.CELER_JUNIT_OUTPUT}}ctest/all.xml"
- name: Install
working-directory: build
run: |
Expand All @@ -81,7 +78,7 @@ jobs:
|| steps.test.outcome == 'failure'}}
with:
name: test-results-ultralite-ubuntu
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1
windows:
Expand Down Expand Up @@ -143,7 +140,7 @@ jobs:
|| steps.test.outcome == 'failure'}}
with:
name: test-results-ultralite-windows
path: "build/test-results.junit.xml"
path: "${{env.CELER_JUNIT_OUTPUT}}**/*.xml"
if-no-files-found: error
retention-days: 1

Expand Down
2 changes: 1 addition & 1 deletion scripts/cmake-presets/ci-windows-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"maxFailedTestOutputSize": 1048576,
"maxPassedTestOutputSize": 65536,
"outputOnFailure": true,
"outputJUnitFile": "test-results.junit.xml"
"outputJUnitFile": "$env{CELER_JUNIT_OUTPUT}\\ctest\\all.xml"
}
},
{"name": "fast", "configurePreset": "fast", "inherits": "base"},
Expand Down

0 comments on commit fc130a2

Please sign in to comment.