Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codeaster-fra
devtools
Commits
da5f6b5f
Commit
da5f6b5f
authored
3 months ago
by
Mathieu Courtois
Browse files
Options
Downloads
Patches
Plain Diff
[#34305] pre-push: improve message, only in src
parent
8b912aad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/hooks/git_hook_main
+1
-1
1 addition, 1 deletion
bin/hooks/git_hook_main
lib/hgaster/hooks/codeaster.py
+21
-11
21 additions, 11 deletions
lib/hgaster/hooks/codeaster.py
with
22 additions
and
12 deletions
bin/hooks/git_hook_main
+
1
−
1
View file @
da5f6b5f
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
lib/hgaster/hooks/codeaster.py
+
21
−
11
View file @
da5f6b5f
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment