Skip to content

Commit

Permalink
Merge pull request easybuilders#3411 from Crivella/feature-qe_new-run…
Browse files Browse the repository at this point in the history
…_shell_cmd

Replace `run_cmd` with `run_shell_cmd` in custom easyblock for QuantumESPRESSO
  • Loading branch information
boegel authored Aug 16, 2024
2 parents 2ddd9fd + ce2c3dd commit 2fff133
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions easybuild/easyblocks/q/quantumespresso.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import copy_dir, copy_file
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_cmd
from easybuild.tools.run import run_shell_cmd

from easybuild.easyblocks.generic.cmakemake import CMakeMake
from easybuild.easyblocks.generic.configuremake import ConfigureMake
Expand Down Expand Up @@ -358,7 +358,8 @@ def test_step(self):
'--output-on-failure',
])

(out, _) = run_cmd(cmd, log_all=False, log_ok=False, simple=False, regexp=False)
res = run_shell_cmd(cmd, fail_on_error=False)
out = res.output

# Example output:
# 74% tests passed, 124 tests failed out of 481
Expand Down Expand Up @@ -1041,7 +1042,7 @@ def test_step(self):
"cd %s" % test_dir,
"sed -i 's|export NETWORK_PSEUDO=.*|export NETWORK_PSEUDO=%s|g' ENVIRONMENT" % pseudo_loc
])
run_cmd(cmd, log_all=False, log_ok=False, simple=False, regexp=False)
run_shell_cmd(cmd, fail_on_error=False)

targets = self.cfg.get('test_suite_targets', [])
allow_fail = self.cfg.get('test_suite_allow_failures', [])
Expand All @@ -1059,7 +1060,8 @@ def test_step(self):
pcmd = 'NPROCS=%d' % parallel

cmd = 'cd %s && %s make run-tests-%s' % (test_dir, pcmd, target)
(out, _) = run_cmd(cmd, log_all=False, log_ok=False, simple=False, regexp=False)
res = run_shell_cmd(cmd, fail_on_error=False)
out = res.output

# Example output:
# All done. 2 out of 2 tests passed.
Expand Down

0 comments on commit 2fff133

Please sign in to comment.