diff --git a/cscs-checks/apps/icon/rrtmgp_check.py b/cscs-checks/apps/icon/rrtmgp_check.py index ca63a63db9..73bfe70841 100644 --- a/cscs-checks/apps/icon/rrtmgp_check.py +++ b/cscs-checks/apps/icon/rrtmgp_check.py @@ -19,14 +19,14 @@ def __init__(self): self.sourcesdir = os.path.join(self.current_system.resourcesdir, 'RRTMGP') self.tags = {'external-resources'} - self.prebuild_cmd = ['cp build/Makefile.conf.dom build/Makefile.conf'] + self.prebuild_cmds = ['cp build/Makefile.conf.dom build/Makefile.conf'] self.executable = 'python' self.executable_opts = [ 'util/scripts/run_tests.py', '--verbose', '--rel_diff_cut 1e-13', '--root ..', '--test ${INIFILE}_ncol-${NCOL}.ini' ] - self.pre_run = [ + self.prerun_cmds = [ 'pwd', 'module load netcdf-python/1.4.1-CrayGNU-19.06-python2', 'cd test' diff --git a/cscs-checks/apps/openfoam/check_openfoam.py b/cscs-checks/apps/openfoam/check_openfoam.py index a14d6635a5..de28ed36be 100644 --- a/cscs-checks/apps/openfoam/check_openfoam.py +++ b/cscs-checks/apps/openfoam/check_openfoam.py @@ -29,7 +29,7 @@ def __init__(self): self.maintainers = ['MKr', 'AJ'] self.tags = {'scs', 'production', 'external-resources'} - self.pre_run = ['source $FOAM_BASH'] + self.prerun_cmds = ['source $FOAM_BASH'] @rfm.simple_test diff --git a/cscs-checks/apps/openfoam/check_openfoam_extend.py b/cscs-checks/apps/openfoam/check_openfoam_extend.py index 8042786364..5b78d86316 100644 --- a/cscs-checks/apps/openfoam/check_openfoam_extend.py +++ b/cscs-checks/apps/openfoam/check_openfoam_extend.py @@ -34,7 +34,7 @@ def __init__(self): self.maintainers = ['MKr', 'AJ'] self.tags = {'scs', 'production', 'external-resources'} - self.pre_run = ['source $FOAM_INST_DIR/foam-extend-4.0/etc/bashrc'] + self.prerun_cmds = ['source $FOAM_INST_DIR/foam-extend-4.0/etc/bashrc'] @rfm.simple_test diff --git a/cscs-checks/apps/spark/spark_check.py b/cscs-checks/apps/spark/spark_check.py index bc8733f84b..563907ab5c 100644 --- a/cscs-checks/apps/spark/spark_check.py +++ b/cscs-checks/apps/spark/spark_check.py @@ -19,8 +19,8 @@ def __init__(self): self.valid_prog_environs = ['builtin'] self.modules = ['Spark'] self.sourcesdir = None - self.pre_run = ['start-all.sh'] - self.post_run = ['stop-all.sh'] + self.prerun_cmds = ['start-all.sh'] + self.postrun_cmds = ['stop-all.sh'] self.num_tasks = 2 self.num_tasks_per_node = 1 pi_value = sn.extractsingle(r'Pi is roughly\s+(?P\S+)', diff --git a/cscs-checks/apps/tensorflow/tensorflow_check.py b/cscs-checks/apps/tensorflow/tensorflow_check.py index 3eb18a6b45..2c2b8e160f 100644 --- a/cscs-checks/apps/tensorflow/tensorflow_check.py +++ b/cscs-checks/apps/tensorflow/tensorflow_check.py @@ -28,8 +28,8 @@ def __init__(self, model_name): # TensorFlow # FIXME: Currently the branch for Tensorflow 1.14.0 is not # available, we use the one for 1.13.0 - # self.pre_run = ['git checkout r%s' % tf_version] - self.pre_run = ['git checkout r1.13.0'] + # self.prerun_cmds = ['git checkout r%s' % tf_version] + self.prerun_cmds = ['git checkout r1.13.0'] self.variables = {'PYTHONPATH': '$PYTHONPATH:.'} @@ -74,6 +74,6 @@ def __init__(self): 0.85, -0.05, None) ]) - self.pre_run += ['mkdir ./official/wide_deep/model_dir', - 'python3 ./official/wide_deep/census_dataset.py ' - '--data_dir ./official/wide_deep/'] + self.prerun_cmds += ['mkdir ./official/wide_deep/model_dir', + 'python3 ./official/wide_deep/census_dataset.py ' + '--data_dir ./official/wide_deep/'] diff --git a/cscs-checks/apps/tensorflow/tf2_horovod_check.py b/cscs-checks/apps/tensorflow/tf2_horovod_check.py index 22751dcb0b..8dafa0aec1 100644 --- a/cscs-checks/apps/tensorflow/tf2_horovod_check.py +++ b/cscs-checks/apps/tensorflow/tf2_horovod_check.py @@ -60,9 +60,9 @@ def __init__(self, variant): 'NCCL_IB_CUDA_SUPPORT': '1', 'OMP_NUM_THREADS': '$SLURM_CPUS_PER_TASK', } - self.pre_run = ['wget https://raw.githubusercontent.com/horovod/' - 'horovod/26b55a7890f6923ca58cdb68a765ed0ec436ab0f/' - 'examples/tensorflow2_synthetic_benchmark.py'] + self.prerun_cmds = ['wget https://raw.githubusercontent.com/horovod/' + 'horovod/26b55a7890f6923ca58cdb68a765ed0ec436ab0f/' + 'examples/tensorflow2_synthetic_benchmark.py'] self.executable = 'python' self.executable_opts = [ 'tensorflow2_synthetic_benchmark.py', diff --git a/cscs-checks/apps/tensorflow/tf_horovod_check.py b/cscs-checks/apps/tensorflow/tf_horovod_check.py index 7f64908145..9a741e1e75 100644 --- a/cscs-checks/apps/tensorflow/tf_horovod_check.py +++ b/cscs-checks/apps/tensorflow/tf_horovod_check.py @@ -47,7 +47,7 @@ def __init__(self, variant): self.sanity_patterns = sn.assert_eq(sn.count(sn.findall( r'total images/sec:', self.stdout)), self.num_tasks) - self.pre_run = ['git checkout cnn_tf_v%s_compatible' % tfshortver] + self.prerun_cmds = ['git checkout cnn_tf_v%s_compatible' % tfshortver] self.variables = { 'NCCL_DEBUG': 'INFO', 'NCCL_IB_HCA': 'ipogif0', diff --git a/cscs-checks/compile/libsci_resolve.py b/cscs-checks/compile/libsci_resolve.py index 4e5350fcee..a369aeeeed 100644 --- a/cscs-checks/compile/libsci_resolve.py +++ b/cscs-checks/compile/libsci_resolve.py @@ -49,7 +49,7 @@ def __init__(self, module_name): # produce any output when xalt/2.7.10 is loaded, thus we use readelf # to find the dynamic libraries of the executable # self.build_system.fflags = ['-Wl,-ydgemm_'] - self.postbuild_cmd = ['readelf -d %s' % self.executable] + self.postbuild_cmds = ['readelf -d %s' % self.executable] @rfm.run_before('sanity') def set_sanity(self): @@ -99,7 +99,7 @@ def __init__(self): # to find the dynamic libraries of the executable # self.build_system.fflags = ['-Wl,-ydgemm_', '-mkl'] self.build_system.fflags = ['-mkl'] - self.postbuild_cmd = ['readelf -d %s' % self.executable] + self.postbuild_cmds = ['readelf -d %s' % self.executable] regex = (r'.*\(NEEDED\).*libmkl_(?P[A-Za-z]+)_(?P\S+)' r'\.so') self.sanity_patterns = sn.all([ diff --git a/cscs-checks/cuda/cuda_memtest_check.py b/cscs-checks/cuda/cuda_memtest_check.py index c4b555bd97..3eaf1006ca 100644 --- a/cscs-checks/cuda/cuda_memtest_check.py +++ b/cscs-checks/cuda/cuda_memtest_check.py @@ -20,7 +20,7 @@ def __init__(self): self.modules = ['cudatoolkit'] src_url = ('https://downloads.sourceforge.net/project/cudagpumemtest/' 'cuda_memtest-1.2.3.tar.gz') - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'wget %s' % src_url, 'tar -xzf cuda_memtest-1.2.3.tar.gz', 'cd cuda_memtest-1.2.3', diff --git a/cscs-checks/cuda/nvml_check.py b/cscs-checks/cuda/nvml_check.py index 12d082de54..69131225b3 100644 --- a/cscs-checks/cuda/nvml_check.py +++ b/cscs-checks/cuda/nvml_check.py @@ -32,7 +32,7 @@ def __init__(self): self.modules = ['craype-accel-nvidia60'] self.build_system = 'SingleSource' self.sourcepath = 'example.c' - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'cp $CUDATOOLKIT_HOME/nvml/example/example.c .', 'patch -i ./nvml_example.patch' ] diff --git a/cscs-checks/libraries/hpx/hpx_stencil.py b/cscs-checks/libraries/hpx/hpx_stencil.py index 4613f1082a..3b963ac2e1 100644 --- a/cscs-checks/libraries/hpx/hpx_stencil.py +++ b/cscs-checks/libraries/hpx/hpx_stencil.py @@ -170,19 +170,18 @@ def set_sanity(self): r'\s*(?P\d+),' r'\s*(?P\d+)', self.stdout) num_threads = self.num_tasks * self.num_cpus_per_task - assert_num_tasks = sn.map(lambda x: sn.assert_eq(int(x.group('lid')), - self.num_tasks), result) - assert_num_threads = sn.map(lambda x: sn.assert_eq(int(x.group('tid')), - num_threads), result) - assert_num_points = sn.map(lambda x: sn.assert_eq(x.group('pts'), - self.nx_opts), result) - assert_num_parts = sn.map(lambda x: sn.assert_eq(x.group('parts'), - self.np_opts), result) - assert_num_steps = sn.map(lambda x: sn.assert_eq(x.group('steps'), - self.nt_opts), result) - - self.sanity_patterns = sn.all(sn.chain(assert_num_tasks, - assert_num_threads, - assert_num_points, - assert_num_parts, - assert_num_steps)) + assert_num_tasks = sn.map( + lambda x: sn.assert_eq(int(x.group('lid')), self.num_tasks), + result) + assert_num_threads = sn.map( + lambda x: sn.assert_eq(int(x.group('tid')), num_threads), result) + assert_num_points = sn.map( + lambda x: sn.assert_eq(x.group('pts'), self.nx_opts), result) + assert_num_parts = sn.map( + lambda x: sn.assert_eq(x.group('parts'), self.np_opts), result) + assert_num_steps = sn.map( + lambda x: sn.assert_eq(x.group('steps'), self.nt_opts), result) + + self.sanity_patterns = sn.all( + sn.chain(assert_num_tasks, assert_num_threads, assert_num_points, + assert_num_parts, assert_num_steps)) diff --git a/cscs-checks/libraries/io/hdf5_compile_run.py b/cscs-checks/libraries/io/hdf5_compile_run.py index 889dbcf516..4a9708f90f 100644 --- a/cscs-checks/libraries/io/hdf5_compile_run.py +++ b/cscs-checks/libraries/io/hdf5_compile_run.py @@ -76,7 +76,7 @@ def __init__(self, lang, linkage): self.num_tasks_per_node = 1 self.build_system = 'SingleSource' self.build_system.ldflags = ['-%s' % linkage] - self.post_run = ['h5dump h5ex_d_chunk.h5 > h5dump_out.txt'] + self.postrun_cmds = ['h5dump h5ex_d_chunk.h5 > h5dump_out.txt'] self.maintainers = ['SO', 'RS'] self.tags = {'production', 'craype'} diff --git a/cscs-checks/libraries/magma/magma_checks.py b/cscs-checks/libraries/magma/magma_checks.py index badefc65f0..80fd93686e 100644 --- a/cscs-checks/libraries/magma/magma_checks.py +++ b/cscs-checks/libraries/magma/magma_checks.py @@ -16,7 +16,7 @@ def __init__(self, subtest): self.num_gpus_per_node = 1 self.sanity_patterns = sn.assert_found(r'Result = PASS', self.stdout) - self.prebuild_cmd = ['patch < patch.txt'] + self.prebuild_cmds = ['patch < patch.txt'] self.build_system = 'Make' self.valid_prog_environs = ['builtin'] self.build_system.makefile = 'Makefile_%s' % subtest diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 85ad606c70..e97514b2e7 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -31,8 +31,8 @@ def __init__(self, linkage): 'PrgEnv-pgi': ['-mp', '-w'] } self.sourcepath = 'example_AmesosFactory_HB.cpp' - self.pre_run = ['wget ftp://math.nist.gov/pub/MatrixMarket2/' - 'misc/hamm/add20.rua.gz', 'gunzip add20.rua.gz'] + self.prerun_cmds = ['wget ftp://math.nist.gov/pub/MatrixMarket2/' + 'misc/hamm/add20.rua.gz', 'gunzip add20.rua.gz'] self.executable_opts = ['add20.rua'] self.modules = ['cray-mpich', 'cray-hdf5-parallel', 'cray-tpsl', 'cray-trilinos'] diff --git a/cscs-checks/mch/collectives_halo.py b/cscs-checks/mch/collectives_halo.py index 2250f69e20..034238f26d 100644 --- a/cscs-checks/mch/collectives_halo.py +++ b/cscs-checks/mch/collectives_halo.py @@ -138,7 +138,7 @@ def __init__(self, variant): }) self.strict_check = False self.sourcesdir = 'https://github.com/eth-cscs/comm_overlap_bench.git' - self.prebuild_cmd = ['git checkout alltoallv'] + self.prebuild_cmds = ['git checkout alltoallv'] @rfm.parameterized_test(['default'], ['nocomm'], ['nocomp']) @@ -158,4 +158,4 @@ def __init__(self, variant): }, }) self.sourcesdir = 'https://github.com/eth-cscs/comm_overlap_bench.git' - self.prebuild_cmd = ['git checkout barebones'] + self.prebuild_cmds = ['git checkout barebones'] diff --git a/cscs-checks/mch/fieldextra_check.py b/cscs-checks/mch/fieldextra_check.py index 9e401f97ea..c15c8ff8d0 100644 --- a/cscs-checks/mch/fieldextra_check.py +++ b/cscs-checks/mch/fieldextra_check.py @@ -37,7 +37,7 @@ def __init__(self, variant): 'cookbook/support/input', 'reference_cookbook' ] - self.pre_run = [ + self.prerun_cmds = [ 'ln -s ${EBROOTFIELDEXTRA}/bin bin', 'ln -s ${EBROOTFIELDEXTRA}/tools tools', 'ln -s ${EBROOTFIELDEXTRA}/resources resources', @@ -69,7 +69,7 @@ def __init__(self): self.executable = 'fieldextra_gnu_opt_omp' self.executable_opts = ['nl.TC'] self.readonly_files = ['18112900_204'] - self.pre_run = ['source create_nl_6h.template'] + self.prerun_cmds = ['source create_nl_6h.template'] self.variables = { 'OMP_STACKSIZE': '500M', 'OMP_NUM_THREADS': '$SLURM_CPUS_PER_TASK', diff --git a/cscs-checks/mch/g2g_meteoswiss_check.py b/cscs-checks/mch/g2g_meteoswiss_check.py index 8ac939d393..86ba7ec5ec 100644 --- a/cscs-checks/mch/g2g_meteoswiss_check.py +++ b/cscs-checks/mch/g2g_meteoswiss_check.py @@ -16,12 +16,12 @@ def __init__(self, g2g): self.valid_prog_environs = ['PrgEnv-gnu'] self.exclusive_access = True self.modules = ['cmake'] - self.pre_run = ["export EXECUTABLE=$(ls src/ | " - "grep 'GNU.*MVAPICH.*CUDA.*kesch.*')"] + self.prerun_cmds = ["export EXECUTABLE=$(ls src/ | " + "grep 'GNU.*MVAPICH.*CUDA.*kesch.*')"] self.executable = 'build/src/comm_overlap_benchmark' self.sourcesdir = ('https://github.com/MeteoSwiss-APN/' 'comm_overlap_bench.git') - self.prebuild_cmd = ['git checkout barebones'] + self.prebuild_cmds = ['git checkout barebones'] self.build_system = 'CMake' self.build_system.builddir = 'build' self.build_system.config_opts = ['-DMPI_VENDOR=mvapich2', diff --git a/cscs-checks/mch/gpu_direct_acc.py b/cscs-checks/mch/gpu_direct_acc.py index 584436a818..7ca0f6a7d9 100644 --- a/cscs-checks/mch/gpu_direct_acc.py +++ b/cscs-checks/mch/gpu_direct_acc.py @@ -51,7 +51,7 @@ def __init__(self): self.sourcepath = 'gpu_direct_acc.F90' self.build_system = 'SingleSource' - self.prebuild_cmd = ['module list -l'] + self.prebuild_cmds = ['module list -l'] self.sanity_patterns = sn.all([ sn.assert_found(r'GPU with OpenACC', self.stdout), sn.assert_found(r'Result :\s+OK', self.stdout) diff --git a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py index 48e673583a..e7af857edf 100644 --- a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py +++ b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py @@ -24,7 +24,7 @@ def __init__(self): self.sourcesdir = 'https://github.com/hpcg-benchmark/hpcg.git' # FIXME: Remove this after the OpenMP pragma gets fixed in hpcg master - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'git checkout 9484cd7f2c4744c783abbdcfd4f5cc34807b42b1' ] self.executable = 'bin/xhpcg' @@ -98,9 +98,9 @@ def __init__(self): self.valid_prog_environs = ['PrgEnv-intel'] self.modules = ['craype-hugepages8M'] self.build_system = 'Make' - self.prebuild_cmd = ['cp -r ${MKLROOT}/benchmarks/hpcg/* .', - 'mv Make.CrayXC setup', - './configure CrayXC'] + self.prebuild_cmds = ['cp -r ${MKLROOT}/benchmarks/hpcg/* .', + 'mv Make.CrayXC setup', + './configure CrayXC'] self.num_tasks = 0 self.num_tasks_per_core = 2 @@ -201,7 +201,7 @@ def __init__(self): self.valid_prog_environs = ['PrgEnv-gnu'] self.modules = ['craype-accel-nvidia60', 'craype-hugepages8M'] self.executable = 'xhpcg_gpu_3.1' - self.pre_run = ['chmod +x %s' % self.executable] + self.prerun_cmds = ['chmod +x %s' % self.executable] self.num_tasks = 0 self.num_tasks_per_node = 1 self.num_cpus_per_task = 12 diff --git a/cscs-checks/microbenchmarks/simd/nsimd.py b/cscs-checks/microbenchmarks/simd/nsimd.py index 3635ecc40f..fbdf7d6f10 100644 --- a/cscs-checks/microbenchmarks/simd/nsimd.py +++ b/cscs-checks/microbenchmarks/simd/nsimd.py @@ -84,7 +84,7 @@ def __init__(self): self.sourcesdir = None self.srcdir = 'benches/cxx_adv' self.sourcepath = '%s/%s.cpp' % (self.srcdir, self.testname) - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'tar xf $EBROOTNSIMD/benches.tar benches/benches.hpp', 'tar xf $EBROOTNSIMD/benches.tar %s' % self.sourcepath, ] diff --git a/cscs-checks/microbenchmarks/simd/vc.py b/cscs-checks/microbenchmarks/simd/vc.py index 19722abeba..fef1d76caa 100644 --- a/cscs-checks/microbenchmarks/simd/vc.py +++ b/cscs-checks/microbenchmarks/simd/vc.py @@ -38,7 +38,7 @@ def __init__(self): src_url = 'https://raw.githubusercontent.com/VcDevel/Vc/1.4/examples' src1 = '%s/tsc.h' % src_url src2 = '%s/finitediff/main.cpp' % src_url - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'wget %s %s' % (src1, src2), 'sed -ie "s-../tsc.h-./tsc.h-" main.cpp', ] diff --git a/cscs-checks/microbenchmarks/spec-accel/spec.py b/cscs-checks/microbenchmarks/spec-accel/spec.py index 51320501fb..53ca4aef03 100644 --- a/cscs-checks/microbenchmarks/spec-accel/spec.py +++ b/cscs-checks/microbenchmarks/spec-accel/spec.py @@ -24,10 +24,10 @@ def __init__(self, prg_envs): app_source = os.path.join(self.current_system.resourcesdir, 'SPEC_ACCELv1.2') - self.prebuild_cmd = ['cp -r %s/* .' % app_source, - './install.sh -d . -f'] + self.prebuild_cmds = ['cp -r %s/* .' % app_source, + './install.sh -d . -f'] - # I just want prebuild_cmd, but no action for the build_system + # I just want prebuild_cmds, but no action for the build_system # is not supported, so I find it something useless to do self.build_system = 'SingleSource' self.sourcepath = './benchspec/ACCEL/353.clvrleaf/src/timer_c.c' @@ -67,8 +67,8 @@ def __init__(self, prg_envs): @rfm.run_after('setup') def setup_per_env(self): envname = self.current_environ.name - self.pre_run = ['source ./shrc', 'mv %s config' % - self.configs[envname]] + self.prerun_cmds = ['source ./shrc', 'mv %s config' % + self.configs[envname]] self.executable_opts = [ '--config=%s' % self.configs[envname], diff --git a/cscs-checks/prgenv/affinity_check.py b/cscs-checks/prgenv/affinity_check.py index 7444db9b15..2f6c2e424a 100644 --- a/cscs-checks/prgenv/affinity_check.py +++ b/cscs-checks/prgenv/affinity_check.py @@ -17,7 +17,7 @@ def __init__(self, variant): # The github URL can not be specifid as `self.sourcedir` as that # would prevent the src folder from being copied to stage which is # necessary since these tests need files from it. - self.prebuild_cmd = ['git clone https://github.com/vkarak/affinity'] + self.prebuild_cmds = ['git clone https://github.com/vkarak/affinity'] self.executable = './affinity/affinity' self.variant = variant self.maintainers = ['RS', 'SK'] diff --git a/cscs-checks/prgenv/helloworld.py b/cscs-checks/prgenv/helloworld.py index 263631fffc..51a97b32a1 100644 --- a/cscs-checks/prgenv/helloworld.py +++ b/cscs-checks/prgenv/helloworld.py @@ -23,8 +23,8 @@ def __init__(self, variant, lang, linkage): self.sourcepath = 'hello_world' self.build_system = 'SingleSource' self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc', - 'kesch:cn', 'tiger:gpu', 'arolla:cn', 'arolla:pn', - 'tsa:cn', 'tsa:pn'] + 'kesch:cn', 'tiger:gpu', 'arolla:cn', + 'arolla:pn', 'tsa:cn', 'tsa:pn'] self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-cray_classic', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] diff --git a/cscs-checks/system/io/ior_check.py b/cscs-checks/system/io/ior_check.py index 844eee8613..61abfcf7c8 100644 --- a/cscs-checks/system/io/ior_check.py +++ b/cscs-checks/system/io/ior_check.py @@ -19,7 +19,7 @@ def __init__(self, base_dir): self.test_dir = os.path.join(self.base_dir, self.username, '.ior') - self.pre_run = ['mkdir -p ' + self.test_dir] + self.prerun_cmds = ['mkdir -p ' + self.test_dir] self.test_file = os.path.join(self.test_dir, 'ior') self.fs = { '/scratch/snx1600tds': { diff --git a/cscs-checks/tools/io/cdo.py b/cscs-checks/tools/io/cdo.py index 042a11fed3..83b7852a60 100644 --- a/cscs-checks/tools/io/cdo.py +++ b/cscs-checks/tools/io/cdo.py @@ -82,7 +82,7 @@ def __init__(self): # then the NCO module to see if there appear any conflicts. If there are no # conflicts then self.stdout and self.stderr are empty. Note that the command # 'module load NCO' cannot be passed via self.executable to srun as 'module' -# is not an executable. Thus, we run the command as a pre_run command and +# is not an executable. Thus, we run the command as a prerun_cmds command and # define as executable just an echo with no arguments. @rfm.simple_test class CDO_NCOModuleCompatibilityTest(CDOBaseTest): @@ -99,7 +99,7 @@ def __init__(self): else: nco_name = 'NCO' - self.pre_run = ['module load %s' % nco_name] + self.prerun_cmds = ['module load %s' % nco_name] @rfm.simple_test diff --git a/cscs-checks/tools/io/nco.py b/cscs-checks/tools/io/nco.py index b253c87713..abe9b64261 100644 --- a/cscs-checks/tools/io/nco.py +++ b/cscs-checks/tools/io/nco.py @@ -75,7 +75,7 @@ def __init__(self): # then the CDO module to see if there appear any conflicts. If there are no # conflicts then self.stdout and self.stderr are empty. Note that the command # 'module load CDO' cannot be passed via self.executable to srun as 'module' -# is not an executable. Thus, we run the command as a pre_run command and +# is not an executable. Thus, we run the command as a prerun_cmds command and # define as executable just an echo with no arguments. @rfm.simple_test class NCO_CDOModuleCompatibilityTest(NCOBaseTest): @@ -92,7 +92,7 @@ def __init__(self): else: cdo_name = 'CDO' - self.pre_run = ['module load %s' % cdo_name] + self.prerun_cmds = ['module load %s' % cdo_name] @rfm.simple_test diff --git a/cscs-checks/tools/profiling_and_debugging/cuda_gdb.py b/cscs-checks/tools/profiling_and_debugging/cuda_gdb.py index dd7c917251..e32d81bee3 100644 --- a/cscs-checks/tools/profiling_and_debugging/cuda_gdb.py +++ b/cscs-checks/tools/profiling_and_debugging/cuda_gdb.py @@ -22,7 +22,7 @@ def __init__(self): self.executable = 'cuda-gdb' self.executable_opts = ['-x .in.cudagdb ./cuda_gdb_check'] # unload xalt to avoid runtime error: - self.pre_run = ['unset LD_PRELOAD'] + self.prerun_cmds = ['unset LD_PRELOAD'] if self.current_system.name == 'kesch': self.exclusive_access = True self.modules = ['cudatoolkit/8.0.61'] diff --git a/cscs-checks/tools/profiling_and_debugging/ddt.py b/cscs-checks/tools/profiling_and_debugging/ddt.py index f9f137ca2e..beea2931a2 100644 --- a/cscs-checks/tools/profiling_and_debugging/ddt.py +++ b/cscs-checks/tools/profiling_and_debugging/ddt.py @@ -54,7 +54,7 @@ def __init__(self, lang, extension): } self.maintainers = ['MKr', 'JG'] self.tags = {'production', 'craype'} - self.post_run = ['ddt -V ; which ddt ;'] + self.postrun_cmds = ['ddt -V ; which ddt ;'] self.keep_files = ['ddtreport.txt'] def setup(self, partition, environ, **job_opts): @@ -73,8 +73,8 @@ def __init__(self, lang, extension): super().__init__(lang, extension) self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc', 'kesch:cn', 'tiger:gpu', 'arolla:cn', 'tsa:cn'] - if (self.current_system.name in ['arolla', 'kesch', 'tsa'] - and self.lang == 'C'): + if (self.current_system.name in ['arolla', 'kesch', 'tsa'] and + self.lang == 'C'): self.build_system.ldflags = ['-lm'] residual_pattern = '_jacobi.%s:%d,residual' diff --git a/cscs-checks/tools/profiling_and_debugging/gdb4hpc.py b/cscs-checks/tools/profiling_and_debugging/gdb4hpc.py index f8c95b8aba..5890f4edbf 100644 --- a/cscs-checks/tools/profiling_and_debugging/gdb4hpc.py +++ b/cscs-checks/tools/profiling_and_debugging/gdb4hpc.py @@ -51,8 +51,8 @@ def __init__(self, lang, extension): # additional jobscript. The reframe jobscript can be copied for that # purpose, by adding the cray_debug_ comments around the job launch # command to be debugged, gdb4hpc is then activated by removing the - # #GDB4HPC comments in the next (post_run) step. - self.pre_run = [ + # #GDB4HPC comments in the next (postrun_cmds) step. + self.prerun_cmds = [ '#GDB4HPC #cray_debug_start', '#GDB4HPC srun %s' % self.target_executable, '#GDB4HPC #cray_debug_end' @@ -61,7 +61,7 @@ def __init__(self, lang, extension): def setup(self, partition, environ, **job_opts): super().setup(partition, environ, **job_opts) # create extra jobscript for gdb4hpc: - self.post_run = [ + self.postrun_cmds = [ 'sed "s-#GDB4HPC --" %s | ' 'egrep -v "output=|error=|^gdb4hpc" &> %s' % (self.job.script_filename, self.gdbslm), diff --git a/cscs-checks/tools/profiling_and_debugging/gperftools_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/gperftools_mpi_omp.py index cef0a66ade..986013cb46 100644 --- a/cscs-checks/tools/profiling_and_debugging/gperftools_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/gperftools_mpi_omp.py @@ -64,13 +64,13 @@ def __init__(self, lang): 'OMP_PROC_BIND': 'true', 'CRAYPE_LINK_TYPE': 'dynamic', } - self.pre_run = [ + self.prerun_cmds = [ 'echo \'#!/bin/bash\' &> %s' % self.split_file, 'echo \'CPUPROFILE=`hostname`.$SLURM_PROCID\' %s >> %s' % (self.exe, self.split_file), 'chmod u+x %s' % (self.split_file), ] - self.post_run = [ + self.postrun_cmds = [ '$EBROOTPPROF/bin/pprof --unit=ms --text --lines %s %s &> %s' % (self.exe, '*.0', self.rpt_file_txt), '$EBROOTPPROF/bin/pprof --pdf %s %s &> %s' % diff --git a/cscs-checks/tools/profiling_and_debugging/intel_sde_berkeley_stream.py b/cscs-checks/tools/profiling_and_debugging/intel_sde_berkeley_stream.py index 5e398980c5..918c463f75 100644 --- a/cscs-checks/tools/profiling_and_debugging/intel_sde_berkeley_stream.py +++ b/cscs-checks/tools/profiling_and_debugging/intel_sde_berkeley_stream.py @@ -31,14 +31,16 @@ def __init__(self): self.build_system.ldflags = ['-g', '-O3', '-qopenmp', '-restrict', '-qopt-streaming-stores', 'always'] exp = '/apps/dom/UES/jenkins/7.0.UP00/mc/easybuild/experimental' - self.pre_run = [ + self.prerun_cmds = [ 'mv %s %s' % (self.executable, self.target_executable), 'module use %s/modules/all' % exp, 'module load sde', 'sde -help' ] self.sanity_patterns = sn.assert_found('Total FLOPs =', self.rpt) - self.post_run = ['SDE/parse-sde.sh %s.* &> %s' % (self.sde, self.rpt)] + self.postrun_cmds = [ + 'SDE/parse-sde.sh %s.* &> %s' % (self.sde, self.rpt) + ] self.maintainers = ['JG'] self.tags = {'scs', 'external-resources'} diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py index 7ea705afcc..8a75755421 100644 --- a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -60,10 +60,12 @@ def __init__(self, lang): 'IPM_HPM': 'PAPI_L1_TCM,PAPI_L2_TCM,PAPI_L3_TCM', } self.txtrpt = 'ipm.rpt' - self.post_run = ['ipm_parse.pl -h', - 'ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt, - 'ipm_parse.pl -html *.ipm.xml', - 'cp *ipm.xml_ipm*/index.html .'] + self.postrun_cmds = [ + 'ipm_parse.pl -h', + 'ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt, + 'ipm_parse.pl -html *.ipm.xml', + 'cp *ipm.xml_ipm*/index.html .' + ] self.maintainers = ['JG', 'MKr'] self.tags = {'production'} diff --git a/cscs-checks/tools/profiling_and_debugging/notool.py b/cscs-checks/tools/profiling_and_debugging/notool.py index 1365375607..2fddf12de1 100644 --- a/cscs-checks/tools/profiling_and_debugging/notool.py +++ b/cscs-checks/tools/profiling_and_debugging/notool.py @@ -63,7 +63,7 @@ def __init__(self, lang): self.tags = {'production'} if self.current_system.name in {'dom', 'daint'}: # get general info about the environment: - self.post_run = ['module list -t'] + self.postrun_cmds = ['module list -t'] self.perf_patterns = { 'elapsed_time': sn.extractsingle(r'Elapsed Time\s*:\s+(\S+)', self.stdout, 1, float) diff --git a/cscs-checks/tools/profiling_and_debugging/nvprof.py b/cscs-checks/tools/profiling_and_debugging/nvprof.py index af99120c8d..5044ed8f0e 100644 --- a/cscs-checks/tools/profiling_and_debugging/nvprof.py +++ b/cscs-checks/tools/profiling_and_debugging/nvprof.py @@ -42,7 +42,7 @@ def __init__(self): self.executable_opts = [self.target_executable] # Reminder: NVreg_RestrictProfilingToAdminUsers=0 (RFC-16) needed since # cuda/10.1 - self.post_run = ['cat /etc/modprobe.d/nvidia.conf'] + self.postrun_cmds = ['cat /etc/modprobe.d/nvidia.conf'] self.sanity_patterns = sn.all([ sn.assert_found('Profiling application: %s' % self.target_executable, self.stderr), diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst index 017b8036ca..6d0fa857ea 100644 --- a/docs/migration_2_to_3.rst +++ b/docs/migration_2_to_3.rst @@ -5,7 +5,7 @@ Migrating to ReFrame 3 ReFrame 3 brings substantial changes in its configuration. The configuration component was completely revised and rewritten from scratch in order to allow much more flexibility in how the framework's configuration options are handled, as well as to ensure the maintainability of the framework in the future. -At the same time, ReFrame 3 deprecates some common pre-2.20 test syntax in favor of the more modern and intuitive pipeline hooks. +At the same time, ReFrame 3 deprecates some common pre-2.20 test syntax in favor of the more modern and intuitive pipeline hooks, as well as renames some regression test attributes. This guide details the necessary steps in order to easily migrate to ReFrame 3. @@ -51,8 +51,7 @@ ReFrame does a pretty good job in converting correctly your old configuration fi ReFrame will generate the new configuration based on what was the actual old configuration after any dynamic generation. - -.. note:: +.. warning:: The very old logging configuration syntax (prior to ReFrame 2.13) is no more recognized and the configuration conversion tool does not take it into account. @@ -166,13 +165,20 @@ Now you have to simply replace the import statement with the following: Similarly for schedulers, the ``reframe.core.schedulers.registry`` module must be replaced with ``reframe.core.backends``. +Other deprecations +================== + +The :attr:`prebuild_cmd` and :attr:`postbuild_cmd` test attributes are replaced by the :attr:`prebuild_cmds` and :attr:`postbuild_cmds` respectively. +Similarly, the :attr:`pre_run` and :attr:`post_run` test attributes are replaced by the :attr:`prerun_cmds` and :attr:`postrun_cmds` respectively. + + + Suppressing deprecation warnings ================================ Although not recommended, you can suppress any deprecation warning issued by ReFrame by passing the ``--no-deprecation-warnings`` flag. - Other Changes ------------- diff --git a/docs/tutorial_advanced.rst b/docs/tutorial_advanced.rst index 43bc01d897..ebbab1b7ed 100644 --- a/docs/tutorial_advanced.rst +++ b/docs/tutorial_advanced.rst @@ -102,16 +102,16 @@ Retrieving the source code from a Git repository It might be the case that a regression test needs to clone its source code from a remote repository. This can be achieved in two ways with ReFrame. -One way is to set the :attr:`sourcesdir` attribute to :class:`None` and explicitly clone or checkout a repository using the :attr:`prebuild_cmd `: +One way is to set the :attr:`sourcesdir` attribute to :class:`None` and explicitly clone or checkout a repository using the :attr:`prebuild_cmds `: .. code-block:: python self.sourcesdir = None - self.prebuild_cmd = ['git clone https://github.com/me/myrepo .'] + self.prebuild_cmds = ['git clone https://github.com/me/myrepo .'] By setting :attr:`sourcesdir` to :class:`None`, you are telling ReFrame that you are going to provide the source files in the stage directory. -The working directory of the :attr:`prebuild_cmd` and :attr:`postbuild_cmd` commands will be the stage directory of the test. +The working directory of the :attr:`prebuild_cmds` and :attr:`postbuild_cmds` commands will be the stage directory of the test. An alternative way to retrieve specifically a Git repository is to assign its URL directly to the :attr:`sourcesdir` attribute: @@ -136,12 +136,12 @@ It is often the case that a configuration step is needed before compiling a code To address this kind of projects, ReFrame aims to offer specific abstractions for "configure-make" style of build systems. It supports `CMake-based `__ projects through the :class:`CMake ` build system, as well as `Autotools-based `__ projects through the :class:`Autotools ` build system. -For other build systems, you can achieve the same effect using the :class:`Make ` build system and the :attr:`prebuild_cmd ` for performing the configuration step. +For other build systems, you can achieve the same effect using the :class:`Make ` build system and the :attr:`prebuild_cmds ` for performing the configuration step. The following code snippet will configure a code with ``./custom_configure`` before invoking ``make``: .. code-block:: python - self.prebuild_cmd = ['./custom_configure -with-mylib'] + self.prebuild_cmds = ['./custom_configure -with-mylib'] self.build_system = 'Make' self.build_system.cppflags = ['-DHAVE_FOO'] self.build_system.flags_from_environ = False @@ -302,7 +302,7 @@ Customizing the Generated Job Script ------------------------------------ It is often the case that you must run some commands before or after the parallel launch of your executable. -This can be easily achieved by using the :attr:`pre_run ` and :attr:`post_run ` attributes of a ReFrame test. +This can be easily achieved by using the :attr:`prerun_cmds ` and :attr:`postrun_cmds ` attributes of a ReFrame test. The following example is a slightly modified version of the previous one. The lower and upper limits for the random numbers are now set inside a helper shell script in |limits.sh|_ and we want also to print the word ``FINISHED`` after our executable has finished. @@ -311,7 +311,7 @@ Here is the test file: .. literalinclude:: ../tutorial/advanced/advanced_example7.py -Notice the use of the :attr:`pre_run` and :attr:`post_run` attributes. +Notice the use of the :attr:`prerun_cmds` and :attr:`postrun_cmds` attributes. These are lists of shell commands that are emitted verbatim in the job script. The generated job script for this example is the following: @@ -338,14 +338,14 @@ ReFrame generates the job shell script using the following pattern: #!/bin/bash -l {job_scheduler_preamble} {test_environment} - {pre_run} + {prerun_cmds} {parallel_launcher} {executable} {executable_opts} - {post_run} + {postrun_cmds} The ``job_scheduler_preamble`` contains the directives that control the job allocation. The ``test_environment`` are the necessary commands for setting up the environment of the test. This is the place where the modules and environment variables specified in :attr:`modules ` and :attr:`variables ` attributes are emitted. -Then the commands specified in :attr:`pre_run ` follow, while those specified in the :attr:`post_run ` come after the launch of the parallel job. +Then the commands specified in :attr:`prerun_cmds ` follow, while those specified in the :attr:`postrun_cmds ` come after the launch of the parallel job. The parallel launch itself consists of three parts: #. The parallel launcher program (e.g., ``srun``, ``mpirun`` etc.) with its options, diff --git a/docs/tutorial_deps.rst b/docs/tutorial_deps.rst index 8709d531b2..63adad37e2 100644 --- a/docs/tutorial_deps.rst +++ b/docs/tutorial_deps.rst @@ -16,7 +16,7 @@ We first create a basic compile-only test, that fetches the benchmarks and build :lines: 92-106 There is nothing particular to that test, except perhaps that you can set :attr:`sourcesdir ` to ``None`` even for a test that needs to compile something. -In such a case, you should at least provide the commands that fetch the code inside the :attr:`prebuild_cmd ` attribute. +In such a case, you should at least provide the commands that fetch the code inside the :attr:`prebuild_cmds ` attribute. For the next test we need to use the OSU benchmark binaries that we just built, so as to run the MPI ping-pong benchmark. Here is the relevant part: diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 66d0016dce..de88b87e73 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -232,6 +232,8 @@ class RegressionTest(metaclass=RegressionTestMeta): #: :default: :class:`None`. build_system = BuildSystemField('build_system', type(None)) + #: .. versionadded:: 3.0 + #: #: List of shell commands to be executed before compiling. #: #: These commands are emitted in the build script before the actual build @@ -240,8 +242,18 @@ class RegressionTest(metaclass=RegressionTestMeta): #: #: :type: :class:`List[str]` #: :default: ``[]`` - prebuild_cmd = fields.TypedField('prebuild_cmd', typ.List[str]) + prebuild_cmds = fields.TypedField('prebuild_cmds', typ.List[str]) + + #: .. deprecated:: 3.0 + #: + #: Use :attr:`prebuild_cmds` instead. + prebuild_cmd = fields.DeprecatedField( + fields.TypedField('prebuild_cmds', typ.List[str]), + "'prebuild_cmd' is deprecated; please use 'prebuild_cmds' instead" + ) + #: .. versionadded:: 3.0 + #: #: List of shell commands to be executed after a successful compilation. #: #: These commands are emitted in the script after the actual build @@ -250,7 +262,15 @@ class RegressionTest(metaclass=RegressionTestMeta): #: #: :type: :class:`List[str]` #: :default: ``[]`` - postbuild_cmd = fields.TypedField('postbuild_cmd', typ.List[str]) + postbuild_cmds = fields.TypedField('postbuild_cmds', typ.List[str]) + + #: .. deprecated:: 3.0 + #: + #: Use :attr:`postbuild_cmds` instead. + postbuild_cmd = fields.DeprecatedField( + fields.TypedField('postbuild_cmds', typ.List[str]), + "'postbuild_cmd' is deprecated; please use 'postbuild_cmds' instead" + ) #: The name of the executable to be launched during the run phase. #: @@ -289,7 +309,7 @@ class RegressionTest(metaclass=RegressionTestMeta): container_platform = ContainerPlatformField('container_platform', type(None)) - #: .. versionadded:: 2.10 + #: .. versionadded:: 3.0 #: #: List of shell commands to execute before launching this job. #: @@ -299,17 +319,34 @@ class RegressionTest(metaclass=RegressionTestMeta): #: #: :type: :class:`List[str]` #: :default: ``[]`` - pre_run = fields.TypedField('pre_run', typ.List[str]) + prerun_cmds = fields.TypedField('prerun_cmds', typ.List[str]) - #: .. versionadded:: 2.10 + #: .. deprecated:: 3.0 + #: + #: Use :attr:`prerun_cmds` instead. + pre_run = fields.DeprecatedField( + fields.TypedField('prerun_cmds', typ.List[str]), + "'pre_run' is deprecated; please use 'prerun_cmds' instead" + ) + + #: .. versionadded:: 3.0 #: #: List of shell commands to execute after launching this job. #: - #: See :attr:`pre_run` for a more detailed description of the semantics. + #: See :attr:`prerun_cmds` for a more detailed description of the + #: semantics. #: #: :type: :class:`List[str]` #: :default: ``[]`` - post_run = fields.TypedField('post_run', typ.List[str]) + postrun_cmds = fields.TypedField('postrun_cmds', typ.List[str]) + + #: .. deprecated:: 3.0 + #: + #: Use :attr:`postrun_cmds` instead. + post_run = fields.DeprecatedField( + fields.TypedField('postrun_cmds', typ.List[str]), + "'post_run' is deprecated; please use 'postrun_cmds' instead" + ) #: List of files to be kept after the test finishes. #: @@ -683,12 +720,12 @@ def _rfm_init(self, name=None, prefix=None): self.valid_prog_environs = [] self.valid_systems = [] self.sourcepath = '' - self.prebuild_cmd = [] - self.postbuild_cmd = [] + self.prebuild_cmds = [] + self.postbuild_cmds = [] self.executable = os.path.join('.', self.name) self.executable_opts = [] - self.pre_run = [] - self.post_run = [] + self.prerun_cmds = [] + self.postrun_cmds = [] self.keep_files = [] self.readonly_files = [] self.tags = set() @@ -1117,9 +1154,9 @@ def compile(self): # Prepare build job build_commands = [ - *self.prebuild_cmd, + *self.prebuild_cmds, *self.build_system.emit_build_commands(self._current_environ), - *self.postbuild_cmd + *self.postbuild_cmds ] user_environ = env.Environment(type(self).__name__, self.modules, self.variables.items()) @@ -1203,7 +1240,7 @@ def run(self): self.executable_opts = [] prepare_container = self.container_platform.emit_prepare_commands() if prepare_container: - self.pre_run += prepare_container + self.prerun_cmds += prepare_container self.job.num_tasks = self.num_tasks self.job.num_tasks_per_node = self.num_tasks_per_node @@ -1214,7 +1251,7 @@ def run(self): exec_cmd = [self.job.launcher.run_command(self.job), self.executable, *self.executable_opts] - commands = [*self.pre_run, ' '.join(exec_cmd), *self.post_run] + commands = [*self.prerun_cmds, ' '.join(exec_cmd), *self.postrun_cmds] user_environ = env.Environment(type(self).__name__, self.modules, self.variables.items()) environs = [ diff --git a/reframe/utility/color.py b/reframe/utility/color.py index 7a27a5ef1e..98b3892e8e 100644 --- a/reframe/utility/color.py +++ b/reframe/utility/color.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: BSD-3-Clause + class ColorRGB: def __init__(self, r, g, b): self.__check_rgb(r) diff --git a/tutorial/advanced/advanced_example7.py b/tutorial/advanced/advanced_example7.py index 08a1399500..9208081433 100644 --- a/tutorial/advanced/advanced_example7.py +++ b/tutorial/advanced/advanced_example7.py @@ -14,8 +14,8 @@ def __init__(self): 'pre- and post-run commands') self.valid_systems = ['*'] self.valid_prog_environs = ['*'] - self.pre_run = ['source scripts/limits.sh'] - self.post_run = ['echo FINISHED'] + self.prerun_cmds = ['source scripts/limits.sh'] + self.postrun_cmds = ['echo FINISHED'] self.executable = './random_numbers.sh' numbers = sn.extractall( r'Random: (?P\S+)', self.stdout, 'number', float) diff --git a/tutorial/advanced/osu/osu_benchmarks.py b/tutorial/advanced/osu/osu_benchmarks.py index 004c8fada4..53e7a18ea7 100644 --- a/tutorial/advanced/osu/osu_benchmarks.py +++ b/tutorial/advanced/osu/osu_benchmarks.py @@ -96,7 +96,7 @@ def __init__(self): self.valid_systems = ['daint:gpu'] self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-pgi', 'PrgEnv-intel'] self.sourcesdir = None - self.prebuild_cmd = [ + self.prebuild_cmds = [ 'wget http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-5.6.2.tar.gz', 'tar xzf osu-micro-benchmarks-5.6.2.tar.gz', 'cd osu-micro-benchmarks-5.6.2' diff --git a/unittests/resources/checks/bad/relative_imports.py b/unittests/resources/checks/bad/relative_imports.py index 5ea294c642..216fc5dce7 100644 --- a/unittests/resources/checks/bad/relative_imports.py +++ b/unittests/resources/checks/bad/relative_imports.py @@ -6,5 +6,5 @@ # # module to test reframe's loader with relative imports # -from .. import hellocheck -from ..hellocheck import HelloTest +from .. import hellocheck +from ..hellocheck import HelloTest diff --git a/unittests/resources/checks/frontend_checks.py b/unittests/resources/checks/frontend_checks.py index 3922dd0053..fbbd2b6ba8 100644 --- a/unittests/resources/checks/frontend_checks.py +++ b/unittests/resources/checks/frontend_checks.py @@ -169,8 +169,8 @@ def __init__(self, sleep_time): print_timestamp = ( "python3 -c \"from datetime import datetime; " "print(datetime.today().strftime('%s.%f'), flush=True)\"") - self.pre_run = [print_timestamp] - self.post_run = [print_timestamp] + self.prerun_cmds = [print_timestamp] + self.postrun_cmds = [print_timestamp] self.sanity_patterns = sn.assert_found(r'.*', self.stdout) self.valid_systems = ['*'] self.valid_prog_environs = ['*'] @@ -199,10 +199,10 @@ def __init__(self, run_to_pass, filename): self.sourcesdir = None self.valid_systems = ['*'] self.valid_prog_environs = ['*'] - self.pre_run = ['current_run=$(cat %s)' % filename] + self.prerun_cmds = ['current_run=$(cat %s)' % filename] self.executable = 'echo $current_run' - self.post_run = ['((current_run++))', - 'echo $current_run > %s' % filename] + self.postrun_cmds = ['((current_run++))', + 'echo $current_run > %s' % filename] self.sanity_patterns = sn.assert_found('%d' % run_to_pass, self.stdout) @@ -229,4 +229,4 @@ def __init__(self): self.sanity_patterns = sn.assert_found(r'hello', self.stdout) self.sourcesdir = None self.sourcepath = 'x.c' - self.prebuild_cmd = ['echo foo > x.c'] + self.prebuild_cmds = ['echo foo > x.c'] diff --git a/unittests/resources/checks_unlisted/good.py b/unittests/resources/checks_unlisted/good.py index a764ba57af..3dfe249e79 100644 --- a/unittests/resources/checks_unlisted/good.py +++ b/unittests/resources/checks_unlisted/good.py @@ -30,7 +30,9 @@ def __repr__(self): return 'MyBaseTest(%s, %s)' % (self.a, self.b) -@rfm.parameterized_test(*({'a': x, 'b': y} for x in range(3) for y in range(2))) +@rfm.parameterized_test( + *({'a': x, 'b': y} for x in range(3) for y in range(2)) +) class AnotherBaseTest(RegressionTest): def __init__(self, a, b): self.a = a diff --git a/unittests/test_pipeline.py b/unittests/test_pipeline.py index 1c2ff1812d..b57d3d5073 100644 --- a/unittests/test_pipeline.py +++ b/unittests/test_pipeline.py @@ -165,8 +165,8 @@ def test_hellocheck_make(remote_exec_ctx): def test_hellocheck_local(hellotest, local_exec_ctx): # Test also the prebuild/postbuild functionality - hellotest.prebuild_cmd = ['touch prebuild', 'mkdir prebuild_dir'] - hellotest.postbuild_cmd = ['touch postbuild', 'mkdir postbuild_dir'] + hellotest.prebuild_cmds = ['touch prebuild', 'mkdir prebuild_dir'] + hellotest.postbuild_cmds = ['touch postbuild', 'mkdir postbuild_dir'] hellotest.keep_files = ['prebuild', 'postbuild', 'prebuild_dir', 'postbuild_dir'] @@ -191,8 +191,8 @@ def stagedir(test): return test.stagedir # Test also the prebuild/postbuild functionality - hellotest.pre_run = ['echo prerun: `pwd`'] - hellotest.post_run = ['echo postrun: `pwd`'] + hellotest.prerun_cmds = ['echo prerun: `pwd`'] + hellotest.postrun_cmds = ['echo postrun: `pwd`'] pre_run_path = sn.extractsingle(r'^prerun: (\S+)', hellotest.stdout, 1) post_run_path = sn.extractsingle(r'^postrun: (\S+)', hellotest.stdout, 1) hellotest.sanity_patterns = sn.all([ @@ -349,7 +349,7 @@ def test_sourcesdir_none_generated_sources(local_exec_ctx): class MyTest(rfm.RegressionTest): def __init__(self): self.sourcesdir = None - self.prebuild_cmd = [ + self.prebuild_cmds = [ "printf '#include \\n int main(){ " "printf(\"Hello, World!\\\\n\"); return 0; }' > hello.c" ] @@ -506,7 +506,7 @@ def __init__(self): @rfm.run_before('run') def setflags(self): - self.post_run = ['echo hello > greetings.txt'] + self.postrun_cmds = ['echo hello > greetings.txt'] @rfm.run_after('run') def check_executable(self): @@ -1026,7 +1026,7 @@ def __init__(self): 'pwd', 'ls', 'cat /etc/os-release' ] self.container_platform.workdir = '/workdir' - self.pre_run = ['touch foo'] + self.prerun_cmds = ['touch foo'] self.sanity_patterns = sn.all([ sn.assert_found( r'^' + self.container_platform.workdir, self.stdout),