Commit fe2a6982 authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'ci_error_report' into 'develop'

CI Fix CDash error report

See merge request orfeotoolbox/otb!526
parents 0fdbb39b 82fdadd7
Pipeline #1900 passed with stages
in 6 minutes and 3 seconds
......@@ -40,12 +40,6 @@ stages:
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 CI/cdash_handler.py
artifacts:
when: on_failure
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
fast-build:
extends: .common
......@@ -67,7 +61,15 @@ fast-build:
- develop
- /^release-[0-9]+\.[0-9]+$/
stage: build
artifacts:
when: always
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
- build/CookBook-*-html.tar.gz
- build/Documentation/Cookbook/latex/CookBook-*.pdf
- build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
debian-build:
extends: .common-build
......@@ -83,10 +85,10 @@ debian-build:
- /^release-[0-9]+\.[0-9]+$/
stage: prepare
before_script:
- git checkout -f -q $CI_COMMIT_SHA
- git lfs install --skip-repo
- git config --global user.email "otbbot@orfeo-toolbox.org"
- git config --global user.name "otbbot"
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- export GIT_LFS_SKIP_SMUDGE=0
artifacts:
expire_in: 24 hrs
when: always
......@@ -95,20 +97,20 @@ debian-build:
- build/*/*/*/*.log # Superbuild log
## Ubuntu superbuild
ubuntu-superbuild-prepare:
ubuntu-xdk-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
ubuntu-superbuild-build:
ubuntu-xdk-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-xdk
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
dependencies:
- ubuntu-superbuild-prepare
- ubuntu-xdk-prepare
artifacts:
paths:
- build/CookBook-*-html.tar.gz
......@@ -116,37 +118,35 @@ ubuntu-superbuild-build:
- build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
## CentOS superbuild
centos-superbuild-prepare:
centos-xdk-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
centos-superbuild-build:
centos-xdk-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
dependencies:
- centos-superbuild-prepare
- centos-xdk-prepare
## MacOS superbuild
macos-superbuild-prepare:
macos-xdk-prepare:
tags:
- macos
extends: .common-prepare
before_script:
# No need to install lfs as this machine is persistent
# No need to do git config
# Checkout the expected branch
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- export GIT_LFS_SKIP_SMUDGE=0
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
macos-superbuild-build:
macos-xdk-build:
tags:
- macos
extends: .common-build
......@@ -154,7 +154,7 @@ macos-superbuild-build:
- ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
- ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
dependencies:
- macos-superbuild-prepare
- macos-xdk-prepare
## Windows
.windows-prepare:
......@@ -218,4 +218,3 @@ windows-8-build:
- ctest -V -S CI/main_packages.cmake
dependencies:
- windows-8-prepare
......@@ -30,7 +30,7 @@ import json
import time
trace = False
trace = True
"""
Check needed environment parameters
......@@ -249,6 +249,34 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
errors = "Errors occur during tests"
return ( state , errors)
def GetReturnValue(self, logfile):
fd = open(logfile)
content = fd.readlines()[0]
fd.close()
return int(content.strip("\n"))
def GetLogStatus(self, logdir):
"""
This function returns the log status of a build as a pair 'state' + 'errors'
"""
configure_rv = os.path.join(logdir, "configure_return_value_log.txt")
build_rv = os.path.join(logdir, "build_return_value_log.txt")
test_rv = os.path.join(logdir, "test_return_value_log.txt")
if os.path.exists( configure_rv ):
if (self.GetReturnValue(configure_rv) != 0):
return ( 'failed' , 'Configure failed')
else:
return ( 'failed' , 'Configure not run')
if os.path.exists( build_rv ):
if (self.GetReturnValue(build_rv) != 0):
return ( 'failed' , 'Build failed')
else:
return ( 'failed' , 'Build not run')
if os.path.exists( test_rv ):
if (self.GetReturnValue(test_rv) != 0):
return ( 'failed' , 'Tests failed')
return ('success', '')
"""
This script aims only at recovering the build url
It uses environment variables setup by Gitlab Runner as default:
......@@ -298,7 +326,7 @@ if __name__ == "__main__":
error = "Failed to get build id"
else:
cdash_url = handler.GetBuildUrl()
( state , error ) = handler.GetBuildStatus()
( state , error ) = handler.GetLogStatus( os.path.join( pdir , "log") )
if trace:
print ( "cdash_url is: " + cdash_url )
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
......
......@@ -47,7 +47,7 @@ set_dash_build_name()
# set pipelines to enable documentation
set(ci_cookbook_profiles mr develop release)
set(ci_doxygen_profiles mr develop release)
set(ci_doxygen_profiles develop release)
list(FIND ci_cookbook_profiles ${ci_profile} ci_do_cookbook)
list(FIND ci_doxygen_profiles ${ci_profile} ci_do_doxygen)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment