From 287251a94376cbcae596993253990193c38cec90 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 7 Mar 2018 16:59:28 +0100 Subject: [PATCH 1/3] Settings no more symlink - Sphinx versioning does not like it and cannot produce the docs correctly. --- Jenkinsfile | 2 +- config/generic.py | 107 ------------------------------------------- reframe/settings.py | 108 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 108 insertions(+), 109 deletions(-) delete mode 100644 config/generic.py mode change 120000 => 100644 reframe/settings.py diff --git a/Jenkinsfile b/Jenkinsfile index 7ce86b7677..59041718c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,7 +91,7 @@ stage('Unittest') { checkout scm sh("""${loginBash} ${moduleDefinition} - ln -sf ../${cscsSettings} reframe/settings.py + cp ${cscsSettings} reframe/settings.py bash ${reframeDir}/${bashScript} -f ${reframeDir} -i ''""") } } diff --git a/config/generic.py b/config/generic.py deleted file mode 100644 index c181d9d303..0000000000 --- a/config/generic.py +++ /dev/null @@ -1,107 +0,0 @@ -# -# Regression settings -# - - -class ReframeSettings: - _reframe_module = 'reframe' - _job_poll_intervals = [1, 2, 3] - _job_submit_timeout = 60 - _checks_path = ['checks/'] - _checks_path_recurse = True - _site_configuration = { - 'systems': { - # Generic system used also in unit tests - 'generic': { - 'descr': 'Generic example system', - - # Adjust to your system's hostname - 'hostnames': ['localhost'], - 'partitions': { - 'login': { - 'scheduler': 'local', - 'modules': [], - 'access': [], - 'environs': ['builtin-gcc'], - 'descr': 'Login nodes' - } - } - } - }, - - 'environments': { - '*': { - 'builtin': { - 'type': 'ProgEnvironment', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - - 'builtin-gcc': { - 'type': 'ProgEnvironment', - 'cc': 'gcc', - 'cxx': 'g++', - 'ftn': 'gfortran', - } - } - } - } - - _logging_config = { - 'level': 'DEBUG', - 'handlers': { - 'reframe.log': { - 'level': 'DEBUG', - 'format': '[%(asctime)s] %(levelname)s: ' - '%(check_info)s: %(message)s', - 'append': False, - }, - - # Output handling - '&1': { - 'level': 'INFO', - 'format': '%(message)s' - }, - 'reframe.out': { - 'level': 'INFO', - 'format': '%(message)s', - 'append': False, - } - } - } - - @property - def version(self): - return self._version - - @property - def reframe_module(self): - return self._reframe_module - - @property - def job_poll_intervals(self): - return self._job_poll_intervals - - @property - def job_submit_timeout(self): - return self._job_submit_timeout - - @property - def checks_path(self): - return self._checks_path - - @property - def checks_path_recurse(self): - return self._checks_path_recurse - - @property - def site_configuration(self): - return self._site_configuration - - @property - def logging_config(self): - return self._logging_config - - -settings = ReframeSettings() diff --git a/reframe/settings.py b/reframe/settings.py deleted file mode 120000 index 2546b3051f..0000000000 --- a/reframe/settings.py +++ /dev/null @@ -1 +0,0 @@ -../config/generic.py \ No newline at end of file diff --git a/reframe/settings.py b/reframe/settings.py new file mode 100644 index 0000000000..c181d9d303 --- /dev/null +++ b/reframe/settings.py @@ -0,0 +1,107 @@ +# +# Regression settings +# + + +class ReframeSettings: + _reframe_module = 'reframe' + _job_poll_intervals = [1, 2, 3] + _job_submit_timeout = 60 + _checks_path = ['checks/'] + _checks_path_recurse = True + _site_configuration = { + 'systems': { + # Generic system used also in unit tests + 'generic': { + 'descr': 'Generic example system', + + # Adjust to your system's hostname + 'hostnames': ['localhost'], + 'partitions': { + 'login': { + 'scheduler': 'local', + 'modules': [], + 'access': [], + 'environs': ['builtin-gcc'], + 'descr': 'Login nodes' + } + } + } + }, + + 'environments': { + '*': { + 'builtin': { + 'type': 'ProgEnvironment', + 'cc': 'cc', + 'cxx': '', + 'ftn': '', + }, + + 'builtin-gcc': { + 'type': 'ProgEnvironment', + 'cc': 'gcc', + 'cxx': 'g++', + 'ftn': 'gfortran', + } + } + } + } + + _logging_config = { + 'level': 'DEBUG', + 'handlers': { + 'reframe.log': { + 'level': 'DEBUG', + 'format': '[%(asctime)s] %(levelname)s: ' + '%(check_info)s: %(message)s', + 'append': False, + }, + + # Output handling + '&1': { + 'level': 'INFO', + 'format': '%(message)s' + }, + 'reframe.out': { + 'level': 'INFO', + 'format': '%(message)s', + 'append': False, + } + } + } + + @property + def version(self): + return self._version + + @property + def reframe_module(self): + return self._reframe_module + + @property + def job_poll_intervals(self): + return self._job_poll_intervals + + @property + def job_submit_timeout(self): + return self._job_submit_timeout + + @property + def checks_path(self): + return self._checks_path + + @property + def checks_path_recurse(self): + return self._checks_path_recurse + + @property + def site_configuration(self): + return self._site_configuration + + @property + def logging_config(self): + return self._logging_config + + +settings = ReframeSettings() From 49802813a9174f29f5764abad3340b2fe23c6d05 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 7 Mar 2018 20:14:49 +0100 Subject: [PATCH 2/3] Fix ci-runner script --- Jenkinsfile | 2 -- ci-scripts/ci-runner.bash | 47 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 59041718c1..78ce51ef66 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,6 @@ def dirPrefix = 'reframe-ci' def loginBash = '#!/bin/bash -l' def bashScript = 'ci-scripts/ci-runner.bash' -def cscsSettings = 'config/cscs.py' def machinesList = ['daint', 'dom', 'kesch', 'leone', 'monch'] def machinesToRun = machinesList def uniqueID @@ -91,7 +90,6 @@ stage('Unittest') { checkout scm sh("""${loginBash} ${moduleDefinition} - cp ${cscsSettings} reframe/settings.py bash ${reframeDir}/${bashScript} -f ${reframeDir} -i ''""") } } diff --git a/ci-scripts/ci-runner.bash b/ci-scripts/ci-runner.bash index e5ffb0242d..430544d363 100644 --- a/ci-scripts/ci-runner.bash +++ b/ci-scripts/ci-runner.bash @@ -1,12 +1,5 @@ #!/bin/bash -############################################################################## -# -# -# SCRIPT VARIABLES -# -# -############################################################################## scriptname=`basename $0` CI_FOLDER="" CI_PUBLIC=0 @@ -68,22 +61,23 @@ run_serial_user_checks() } -############################################################################## -# -# -# MAIN SCRIPT -# -# -############################################################################## +save_settings() +{ + tempfile=$(mktemp) + cp reframe/settings.py $tempfile + echo $tempfile +} -# -# Getting the machine name from the cmd line arguments -# +restore_settings() +{ + saved=$1 + cp saved reframe/settings.py + /bin/rm $1 +} + + +### Main script ### -# -# GNU Linux version -# -shortopts="h,p,t,f:,i:,l:,m:" longopts="help,public-only,tutorial-only,folder:,invocation:,load-profile:,module-use:" eval set -- $(getopt -o ${shortopts} -l ${longopts} \ @@ -164,8 +158,6 @@ echo "Running regression on $(hostname) in ${CI_FOLDER}" if [ $CI_PUBLIC -eq 1 ]; then # Run unit tests for the public release - ln -sf ../config/generic.py reframe/settings.py - echo "=================================" echo "Running public release unit tests" echo "=================================" @@ -174,7 +166,8 @@ if [ $CI_PUBLIC -eq 1 ]; then grep -- '--- Logging error ---' elif [ $CI_TUTORIAL -eq 1 ]; then # Run tutorial checks - ln -sf ../tutorial/config/settings.py reframe/settings.py + settings_orig=$(save_settings) + cp tutorial/config/settings.py reframe/settings.py # Find modified or added tutorial checks tutorialchecks=( $(git log --name-status --oneline --no-merges -1 | \ awk '/^[AM]/ { print $2 } /^R0[0-9][0-9]/ { print $3 }' | \ @@ -195,11 +188,15 @@ elif [ $CI_TUTORIAL -eq 1 ]; then run_tutorial_checks ${tutorialchecks_path} ${invocations[i]} done fi + + restore_settings $settings_orig else # Performing the unittests echo "==================" echo "Running unit tests" echo "==================" + settings_orig=$(save_settings) + cp config/cscs.py reframe/settings.py checked_exec ./test_reframe.py # Find modified or added user checks @@ -226,5 +223,7 @@ else run_serial_user_checks ${userchecks_path} ${invocations[i]} done fi + + restore_settings $settings_orig fi exit $CI_EXITCODE From 0ab500f7b7c6734c1951c8de417cbc0d4f6a5291 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 7 Mar 2018 21:50:30 +0100 Subject: [PATCH 3/3] Fix ci bash script --- Jenkinsfile | 2 +- ci-scripts/ci-runner.bash | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 78ce51ef66..91f7c1dffe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -132,7 +132,7 @@ stage('Public Test') { def reframeDir = "${scratch}/${dirPrefix}-dom-${uniqueID}" dir(reframeDir) { sh("""${loginBash} - bash ${reframeDir}/$bashScript -f ${reframeDir} -i '' -p""") + bash ${reframeDir}/$bashScript -f ${reframeDir} -i '' -g""") } } currentBuild.result = "SUCCESS" diff --git a/ci-scripts/ci-runner.bash b/ci-scripts/ci-runner.bash index 430544d363..61c1a0d6f1 100644 --- a/ci-scripts/ci-runner.bash +++ b/ci-scripts/ci-runner.bash @@ -2,7 +2,7 @@ scriptname=`basename $0` CI_FOLDER="" -CI_PUBLIC=0 +CI_GENERIC=0 CI_TUTORIAL=0 TERM="${TERM:-xterm}" PROFILE="" @@ -24,7 +24,7 @@ Usage: $(tput setaf 1)$scriptname$(tput sgr0) $(tput setaf 3)[OPTIONS]$(tput sgr $(tput setaf 3)-i | --invocation$(tput sgr0) $(tput setaf 1)ARGS$(tput sgr0) invocation for modified user checks. Multiple \`-i' options are multiple invocations $(tput setaf 3)-l | --load-profile$(tput sgr0) $(tput setaf 1)ARGS$(tput sgr0) sources the given file before any execution of commands $(tput setaf 3)-m | --module-use$(tput sgr0) $(tput setaf 1)ARGS$(tput sgr0) executes module use of the give folder before loading the regression - $(tput setaf 3)-p | --public-only$(tput sgr0) executes only the public version of the unittests + $(tput setaf 3)-g | --generic-only$(tput sgr0) executes unit tests using the generic configuration $(tput setaf 3)-t | --tutorial-only$(tput sgr0) executes only the modified/new tutorial tests $(tput setaf 3)-h | --help$(tput sgr0) prints this help and exits @@ -71,14 +71,15 @@ save_settings() restore_settings() { saved=$1 - cp saved reframe/settings.py - /bin/rm $1 + cp $saved reframe/settings.py + /bin/rm $saved } ### Main script ### -longopts="help,public-only,tutorial-only,folder:,invocation:,load-profile:,module-use:" +shortopts="h,g,t,f:,i:,l:,m:" +longopts="help,generic-only,tutorial-only,folder:,invocation:,load-profile:,module-use:" eval set -- $(getopt -o ${shortopts} -l ${longopts} \ -n ${scriptname} -- "$@" 2> /dev/null) @@ -107,9 +108,9 @@ while [ $# -ne 0 ]; do -m | --module-use) shift MODULEUSE="$1" ;; - -p | --public-only) + -g | --generic-only) shift - CI_PUBLIC=1 ;; + CI_GENERIC=1 ;; -t | --tutorial-only) shift CI_TUTORIAL=1 ;; @@ -156,11 +157,11 @@ module list cd ${CI_FOLDER} echo "Running regression on $(hostname) in ${CI_FOLDER}" -if [ $CI_PUBLIC -eq 1 ]; then +if [ $CI_GENERIC -eq 1 ]; then # Run unit tests for the public release - echo "=================================" - echo "Running public release unit tests" - echo "=================================" + echo "========================================" + echo "Running unit tests with generic settings" + echo "========================================" checked_exec ./test_reframe.py checked_exec ! ./bin/reframe.py --system=generic -l 2>&1 | \ grep -- '--- Logging error ---' @@ -168,6 +169,7 @@ elif [ $CI_TUTORIAL -eq 1 ]; then # Run tutorial checks settings_orig=$(save_settings) cp tutorial/config/settings.py reframe/settings.py + # Find modified or added tutorial checks tutorialchecks=( $(git log --name-status --oneline --no-merges -1 | \ awk '/^[AM]/ { print $2 } /^R0[0-9][0-9]/ { print $3 }' | \ @@ -179,9 +181,9 @@ elif [ $CI_TUTORIAL -eq 1 ]; then tutorialchecks_path="${tutorialchecks_path} -c ${check}" done - echo "====================" + echo "========================" echo "Modified tutorial checks" - echo "====================" + echo "========================" echo ${tutorialchecks_path} for i in ${!invocations[@]}; do @@ -197,6 +199,7 @@ else echo "==================" settings_orig=$(save_settings) cp config/cscs.py reframe/settings.py + checked_exec ./test_reframe.py # Find modified or added user checks