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
03e8b27e
Commit
03e8b27e
authored
Nov 27, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
df954148
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
slapos/recipe/build/tests.py
slapos/recipe/build/tests.py
+22
-0
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+0
-1
No files found.
slapos/recipe/build/tests.py
View file @
03e8b27e
...
...
@@ -15,6 +15,7 @@ optionflags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
GIT_REPOSITORY
=
'https://lab.nexedi.com/nexedi/slapos.recipe.build.git'
BAD_GIT_REPOSITORY
=
'http://git.erp5.org/repos/nowhere'
GIT_REPOSITORY_WITH_SUBMODULES
=
'https://lab.nexedi.com/tiwariayush/erp5'
REVISION
=
'2566127'
def
setUp
(
test
):
...
...
@@ -126,6 +127,27 @@ class GitCloneNonInformativeTests(unittest.TestCase):
def
test_ignore_ssl_certificate_false
(
self
):
self
.
test_ignore_ssl_certificate
(
ignore_ssl_certificate
=
False
)
def
test_clone_submodules_by_default
(
self
,
ignore_submodules
=
False
):
recipe
=
self
.
makeGitCloneRecipe
(
{
'repository'
:
GIT_REPOSITORY_WITH_SUBMODULES
,
'branch'
:
'pyodide'
,
'clone_submodules'
:
str
(
ignore_submodules
).
lower
()}
)
recipe
.
install
()
git_repository_path
=
os
.
path
.
join
(
self
.
parts_directory_path
,
"test"
)
self
.
assertTrue
(
os
.
path
.
exists
(
git_repository_path
))
submodule_repo_path
=
os
.
path
.
join
(
git_repository_path
,
"bt5/erp5_notebook"
)
# Check if the folder exists
self
.
assertTrue
(
os
.
path
.
exists
(
git_repository_path
))
# Check is there is anything in submodule repository path
if
not
ignore_submodules
:
self
.
assertTrue
(
os
.
listdir
(
submodule_repo_path
))
else
:
self
.
assertFalse
(
os
.
listdir
(
submodule_repo_path
))
def
test_ignore_cloning_submodules
(
self
):
self
.
test_clone_ignore_submodules_by_default
(
ignore_submodules
=
True
)
def
test_suite
():
suite
=
unittest
.
TestSuite
((
doctest
.
DocFileSuite
(
...
...
slapos/recipe/gitclone.py
View file @
03e8b27e
...
...
@@ -153,7 +153,6 @@ class Recipe(object):
self
.
networkcache
=
buildout
.
get
(
'networkcache'
,
{})
# Check if input is correct
if
not
self
.
repository
:
raise
UserError
(
'repository parameter is mandatory.'
)
...
...
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