Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.build
Commits
0216d4b9
Commit
0216d4b9
authored
Jan 15, 2019
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logging
parent
970dd4d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
slapos/recipe/build/tests.py
slapos/recipe/build/tests.py
+4
-4
No files found.
slapos/recipe/build/tests.py
View file @
0216d4b9
import
doctest
import
doctest
from
zope.testing
import
renormalizing
from
zope.testing
import
renormalizing
import
logging
import
os
import
os
import
re
import
re
import
shutil
import
shutil
...
@@ -9,7 +10,6 @@ import subprocess
...
@@ -9,7 +10,6 @@ import subprocess
import
tempfile
import
tempfile
import
unittest
import
unittest
import
zc.buildout.testing
import
zc.buildout.testing
from
logging
import
log
from
subprocess
import
check_call
,
check_output
from
subprocess
import
check_call
,
check_output
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
GIT_CLONE_CACHE_ERROR_MESSAGE
GIT_CLONE_CACHE_ERROR_MESSAGE
...
@@ -89,7 +89,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -89,7 +89,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
subprocess
.
check_call
(
'git add .'
,
cwd
=
proj_dir
,
shell
=
True
)
subprocess
.
check_call
(
'git add .'
,
cwd
=
proj_dir
,
shell
=
True
)
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
# XXX: This is ugly and old. Change it before review
# XXX: This is ugly and old. Change it before review
log
.
error
(
"'git add .' failed with '{}'"
.
format
(
e
.
returncode
))
log
ging
.
error
(
"'git add .' failed with '{}'"
.
format
(
e
.
returncode
))
def
git_commit
(
self
,
proj_dir
,
msg
):
def
git_commit
(
self
,
proj_dir
,
msg
):
"""runs a 'git commit -m msg' in the provided git repo
"""runs a 'git commit -m msg' in the provided git repo
...
@@ -98,7 +98,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -98,7 +98,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
try
:
try
:
subprocess
.
check_call
(
'git commit -m "{}"'
.
format
(
msg
),
cwd
=
proj_dir
,
shell
=
True
)
subprocess
.
check_call
(
'git commit -m "{}"'
.
format
(
msg
),
cwd
=
proj_dir
,
shell
=
True
)
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
log
.
error
(
"'git commit' failed with '{}'"
.
format
(
e
.
returncode
))
log
ging
.
error
(
"'git commit' failed with '{}'"
.
format
(
e
.
returncode
))
def
get_repo_head_commit
(
self
,
proj_dir
,
branch
=
'master'
):
def
get_repo_head_commit
(
self
,
proj_dir
,
branch
=
'master'
):
"""
"""
...
@@ -109,7 +109,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -109,7 +109,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
cwd
=
proj_dir
,
shell
=
True
).
decode
(
"utf-8"
)
cwd
=
proj_dir
,
shell
=
True
).
decode
(
"utf-8"
)
return
output
.
rstrip
()
return
output
.
rstrip
()
except
subprocess
.
CalledProcessError
:
except
subprocess
.
CalledProcessError
:
log
.
error
(
"failed to call 'git rev-parse'"
)
log
ging
.
error
(
"failed to call 'git rev-parse'"
)
return
None
return
None
def
makeGitCloneRecipe
(
self
,
options
):
def
makeGitCloneRecipe
(
self
,
options
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment