Skip to content

Commit

Permalink
Merge branch 'ci-summarize-logs' into 'master'
Browse files Browse the repository at this point in the history
Added CI job summarizing OGS log files from failed ctests

See merge request ogs/ogs!5043
  • Loading branch information
bilke committed Aug 7, 2024
2 parents fc4d513 + 1a073ec commit c91123c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ endif()
set(_envrc_content
"[ -d \"${PROJECT_BINARY_DIR}/.venv\" ] && source ${PROJECT_BINARY_DIR}/.venv/bin/activate"
"export PATH=$PATH:${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}"
"export CTEST_OUTPUT_ON_FAILURE=1"
)
if(TFEL_WITH_PYTHON)
set(_envrc_content "${_envrc_content}"
Expand Down
3 changes: 0 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@
{
"name": "release",
"configurePreset": "release",
"output": {
"outputOnFailure": true
},
"filter": {
"include": {
"label": "default"
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/extends/template-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- rm -rf $build_dir_full
- mkdir -p $build_dir_full build
- if [[ "$OSTYPE" == "darwin"* ]] ; then readlink_cmd=greadlink; else readlink_cmd=readlink; fi
- ln -s `$readlink_cmd -f $build_dir_full` build/${CMAKE_PRESET}
- ln -s `$readlink_cmd -f $build_dir_full` build/${CMAKE_PRESET}-${CI_JOB_NAME_SLUG}-${CI_JOB_ID}
- ([[ $BUILD_CTEST_LARGE_ON_MASTER && "${CI_COMMIT_BRANCH}" == "master" ]]) && export BUILD_CTEST_LARGE=true
- cmake --preset=$CMAKE_PRESET --log-level=VERBOSE -Wno-dev $CMAKE_ARGS
# Activate .venv via .envrc
Expand Down
5 changes: 3 additions & 2 deletions scripts/ci/extends/template-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
variables:
script:
- $build_directory_full = "..\build\" + $env:CMAKE_PRESET
- $artifacts_dir = "build\" + $env:CMAKE_PRESET + "-" + $env:CI_JOB_NAME_SLUG + "-" + $env:CI_JOB_ID
- $log_file = $build_directory_full + "\make.txt"
- (rm -r -fo $build_directory_full)
- cmd /c if not exist $build_directory_full mkdir $build_directory_full
- mkdir build
- mkdir build # We are inside the OGS source directory, now. This "build" dir will be, too.
# Create symlink https://stackoverflow.com/a/34905638/80480
- cmd /c mklink /D build\$env:CMAKE_PRESET $env:CI_PROJECT_DIR\$build_directory_full
- cmd /c mklink /D $artifacts_dir $env:CI_PROJECT_DIR\$build_directory_full
- $cmake_cmd = "cmake --preset=$env:CMAKE_PRESET --log-level=VERBOSE -Wno-dev $env:CMAKE_ARGS"
- $cmake_cmd
- Invoke-Expression $cmake_cmd
Expand Down
22 changes: 22 additions & 0 deletions scripts/ci/jobs/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ create cpm cache:
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ext.tar.gz \
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/external-dependencies/${EXT_VERSION}/ext.tar.gz
aggregate ctest logs:
stage: package
tags: [envinf, shell]
script:
- |
python -m venv .venv_custom_job
. .venv_custom_job/bin/activate
pip install pandas
mkdir -p build/log_summary
set -x
Applications/Python/ogs/dev/ogs_log_summary.py --snippet-out build/log_summary/ -v build/*/logs &>build/log_summary/ogs_log_summary.txt
rules:
- when: always
artifacts:
name: all-artifacts
paths:
- "build/**/*.txt"
- "build/log_summary/**"
expire_in: 12 hrs


offline configure:
stage: package
tags: [envinf, shell]
Expand Down
5 changes: 1 addition & 4 deletions scripts/cmake/test/Test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ NotebookTest(
TRUE
)

# output 25 kb of tailed logs on failure
set(_ctest_parameter -T Test --force-new-ctest-process --output-on-failure
--test-output-size-failed 25
)
set(_ctest_parameter -T Test --force-new-ctest-process)
if(CMAKE_CONFIGURATION_TYPES)
list(APPEND _ctest_parameter --build-config "$<CONFIGURATION>")
endif()
Expand Down

0 comments on commit c91123c

Please sign in to comment.