Skip to content
Merged
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
4 changes: 1 addition & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -91,7 +90,6 @@ stage('Unittest') {
checkout scm
sh("""${loginBash}
${moduleDefinition}
ln -sf ../${cscsSettings} reframe/settings.py
bash ${reframeDir}/${bashScript} -f ${reframeDir} -i ''""")
}
}
Expand Down Expand Up @@ -134,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"
Expand Down
72 changes: 37 additions & 35 deletions ci-scripts/ci-runner.bash
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#!/bin/bash

##############################################################################
#
#
# SCRIPT VARIABLES
#
#
##############################################################################
scriptname=`basename $0`
CI_FOLDER=""
CI_PUBLIC=0
CI_GENERIC=0
CI_TUTORIAL=0
TERM="${TERM:-xterm}"
PROFILE=""
Expand All @@ -31,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

Expand Down Expand Up @@ -68,23 +61,25 @@ 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 $saved
}

#
# GNU Linux version
#
shortopts="h,p,t,f:,i:,l:,m:"
longopts="help,public-only,tutorial-only,folder:,invocation:,load-profile:,module-use:"

### Main script ###

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)
Expand Down Expand Up @@ -113,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 ;;
Expand Down Expand Up @@ -162,19 +157,19 @@ 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
ln -sf ../config/generic.py reframe/settings.py

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 ---'
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 }' | \
Expand All @@ -186,20 +181,25 @@ 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
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
Expand All @@ -226,5 +226,7 @@ else
run_serial_user_checks ${userchecks_path} ${invocations[i]}
done
fi

restore_settings $settings_orig
fi
exit $CI_EXITCODE
107 changes: 0 additions & 107 deletions config/generic.py

This file was deleted.

1 change: 0 additions & 1 deletion reframe/settings.py

This file was deleted.

107 changes: 107 additions & 0 deletions reframe/settings.py
Original file line number Diff line number Diff line change
@@ -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()