Skip to content
Snippets Groups Projects
Commit da5f6b5f authored by Mathieu Courtois's avatar Mathieu Courtois
Browse files

[#34305] pre-push: improve message, only in src

parent 8b912aad
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ def main(repotype, repopath, hook, amend, *args): ...@@ -38,7 +38,7 @@ def main(repotype, repopath, hook, amend, *args):
return OK return OK
if hook == "pre-push": if hook == "pre-push":
return run_ctest_minimal() return run_ctest_minimal(repopath)
logger.error(_("hook '{0}' is not defined").format(hook)) logger.error(_("hook '{0}' is not defined").format(hook))
return 1 return 1
......
...@@ -126,32 +126,42 @@ def aslint(repopath, paths=(), amend=False): ...@@ -126,32 +126,42 @@ def aslint(repopath, paths=(), amend=False):
return OK return OK
def run_ctest_minimal(): def run_ctest_minimal(repopath):
"""Run a minimal list of testcases.""" """Run a minimal list of testcases.
Arguments:
repopath (str): Repository path.
"""
from subprocess import call from subprocess import call
from aslint.base_checkers import checkcontext
from aslint.check_files import read_waf_parameters from aslint.check_files import read_waf_parameters
from aslint.config import ASCFG from aslint.config import ASCFG
logger.warning("Run a minimal list of testcases (for about 30 seconds).") checkcontext.reponame = get_repo_name(repopath)
logger.info("NB: It will used the already installed version.") if checkcontext.reponame != "src":
try:
answ = input("Do you want to continue (y/[n], 'Ctrl+C' to abort push) ? ")
except KeyboardInterrupt:
return NOOK
if answ.lower() not in ("y", "o"):
logger.info("run_ctest skipped.")
return OK return OK
logger.warning("Run a minimal list of testcases (for about 30 seconds).")
builddir = ASCFG.get("waf.builddir") builddir = ASCFG.get("waf.builddir")
target = "release" target = "release"
if os.environ.get("BUILD") == "debug": if os.environ.get("BUILD") == "debug":
builddir = "build/mpidebug" if osp.isdir("build/mpidebug") else "build/mpi" builddir = "build/mpidebug" if osp.isdir("build/mpidebug") else "build/mpi"
target = "debug" target = "debug"
wafc4che = osp.join(builddir, "c4che", target + "_cache.py") wafc4che = osp.join(builddir, "c4che", target + "_cache.py")
c4che = read_waf_parameters(wafc4che) c4che = read_waf_parameters(wafc4che)
run_ctest = Path(c4che["BINDIR"]) / "run_ctest" run_ctest = Path(c4che["BINDIR"]) / "run_ctest"
logger.info("NB: This version will be used: %s", run_ctest)
try:
answ = input("Do you want to continue (y/[n], 'Ctrl+C' to abort push) ? ")
except KeyboardInterrupt:
return NOOK
if answ.lower() not in ("y", "o"):
logger.info("run_ctest skipped.")
return OK
cmd = [run_ctest, "-R", "(asrun0|mumps02b|supv002|vocab0|zzzz509j)", "--no-resutest"] cmd = [run_ctest, "-R", "(asrun0|mumps02b|supv002|vocab0|zzzz509j)", "--no-resutest"]
if call(cmd): if call(cmd):
return NOOK return NOOK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment