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
970dd4d4
Commit
970dd4d4
authored
Jan 14, 2019
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests
parent
36da1c49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
slapos/recipe/build/tests.py
slapos/recipe/build/tests.py
+10
-5
No files found.
slapos/recipe/build/tests.py
View file @
970dd4d4
...
...
@@ -16,8 +16,8 @@ from slapos.recipe.gitclone import GIT_CLONE_ERROR_MESSAGE, \
optionflags
=
(
doctest
.
ELLIPSIS
|
doctest
.
NORMALIZE_WHITESPACE
)
GIT_REPOSITORY
=
'http://git.erp5.org/repos/slapos.recipe.build.git'
BAD_GIT_REPOSITORY
=
'http://git.erp5.org/repos/nowhere'
GIT_SUBMODULE_REPOSITORY
=
'https://lab.nexedi.com/tiwariayush/test_erp5_submodule'
REVISION
=
'2566127'
def
setUp
(
test
):
...
...
@@ -34,6 +34,8 @@ class GitCloneNonInformativeTests(unittest.TestCase):
def
setUp
(
self
):
self
.
dir
=
os
.
path
.
realpath
(
tempfile
.
mkdtemp
())
self
.
parts_directory_path
=
os
.
path
.
join
(
self
.
dir
,
'test_parts'
)
def
setUpSubmoduleRepo
(
self
):
# Create a main repo as well as a submodule repo
# Add files in both main as well as submodule repo
subprocess
.
check_call
(
'mkdir main_repo'
,
cwd
=
self
.
dir
,
shell
=
True
)
...
...
@@ -119,7 +121,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
}
}
default_options
=
{
'repository'
:
self
.
project_dir
'repository'
:
GIT_REPOSITORY
}
default_options
.
update
(
**
options
)
return
Recipe
(
bo
,
'test'
,
default_options
)
...
...
@@ -154,7 +156,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
git_repository_path
))
self
.
assertFalse
(
os
.
path
.
exists
(
bad_file_path
),
"pyc file not removed"
)
def
test_clone_and_udpate_submodule
(
self
):
def
test_
01_
clone_and_udpate_submodule
(
self
):
"""
STEP I:
Repositories status: Main repo(M1) and Submodule repo (S1)
...
...
@@ -171,6 +173,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
Main repo (M3) ---references---> Submodule(S2)
Install should be M3+S2
"""
self
.
setUpSubmoduleRepo
()
# STEP I: Clone repositories in status M1 and S1 (M1---->S1)
recipe
=
self
.
makeGitCloneRecipe
(
{
...
...
@@ -267,7 +270,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
}
}
options
=
{
'repository'
:
self
.
project_dir
,
'repository'
:
GIT_REPOSITORY
,
"ignore-ssl-certificate"
:
str
(
ignore_ssl_certificate
).
lower
(),
}
recipe
=
slapos
.
recipe
.
gitclone
.
Recipe
(
bo
,
'test'
,
options
)
...
...
@@ -285,6 +288,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
self
.
test_ignore_ssl_certificate
(
ignore_ssl_certificate
=
False
)
def
test_clone_submodules_by_default
(
self
,
ignore_cloning_submodules
=
False
):
self
.
setUpSubmoduleRepo
()
recipe
=
self
.
makeGitCloneRecipe
(
{
'repository'
:
self
.
project_dir
,
'ignore-cloning-submodules'
:
str
(
ignore_cloning_submodules
).
lower
()}
...
...
@@ -309,6 +313,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
should udpate the main repo as well as submodule repo if the reference of
submodule in main repo has been udpated.
"""
self
.
setUpSubmoduleRepo
()
recipe
=
self
.
makeGitCloneRecipe
(
{
'repository'
:
self
.
project_dir
}
)
...
...
@@ -341,7 +346,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
# Make another git clone of submodule and check the HEAD of the repo.
submodule_recipe
=
self
.
makeGitCloneRecipe
(
{
'repository'
:
GIT_SUBMODULE_REPOSITORY
}
{
'repository'
:
self
.
submodule_dir
}
)
submodule_recipe
.
install
()
# Check the HEAD of the submodule
...
...
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