Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
erp5
Commits
ce3ce341
Commit
ce3ce341
authored
Sep 02, 2015
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: make code more robust when checkout git files
parent
71677792
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+29
-0
erp5/util/testnode/Updater.py
erp5/util/testnode/Updater.py
+2
-2
No files found.
erp5/tests/testERP5TestNode.py
View file @
ce3ce341
...
@@ -356,6 +356,35 @@ ignore-ssl-certificate = true
...
@@ -356,6 +356,35 @@ ignore-ssl-certificate = true
finally
:
finally
:
Updater
.
deleteRepository
=
original_deleteRepository
Updater
.
deleteRepository
=
original_deleteRepository
def
test_05d_LocalModifcationOnRepository
(
self
):
"""
It could happen that there is local modification to to either bug of
git or any manual operation.
Testnode must be able reset the repository to make sure we have no failures
when updating repository
"""
commit_dict
=
self
.
generateTestRepositoryList
(
add_third_repository
=
True
)
test_node
=
self
.
getTestNode
()
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
self
.
updateNodeTestSuiteData
(
node_test_suite
)
rev_list
=
test_node
.
getAndUpdateFullRevisionList
(
node_test_suite
)
self
.
assertEquals
(
2
,
len
(
rev_list
))
self
.
assertEquals
(
2
,
len
(
node_test_suite
.
vcs_repository_list
))
rep0_clone_path
=
[
x
[
'repository_path'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'repository_path'
].
endswith
(
"rep0"
)][
0
]
my_file
=
open
(
os
.
path
.
join
(
rep0_clone_path
,
'first_file'
),
'w'
)
my_file
.
write
(
"next_content"
)
my_file
.
close
()
# make sure code still works
rev_list
=
test_node
.
getAndUpdateFullRevisionList
(
node_test_suite
)
self
.
assertEqual
(
2
,
len
(
rev_list
))
self
.
assertEqual
(
2
,
len
(
node_test_suite
.
vcs_repository_list
))
# and check local change was resetted
my_file
=
open
(
os
.
path
.
join
(
rep0_clone_path
,
'first_file'
),
'r'
)
self
.
assertEqual
(
"initial_content0"
,
my_file
.
read
())
my_file
.
close
()
def
test_06_checkRevision
(
self
):
def
test_06_checkRevision
(
self
):
"""
"""
Check if we are able to restore older commit hash if master decide so
Check if we are able to restore older commit hash if master decide so
...
...
erp5/util/testnode/Updater.py
View file @
ce3ce341
...
@@ -210,8 +210,8 @@ class Updater(object):
...
@@ -210,8 +210,8 @@ class Updater(object):
self._git('
branch
', '
-
D
', self.branch)
self._git('
branch
', '
-
D
', self.branch)
self._git('
checkout
', '
origin
/%
s
' % self.branch, '
-
b',
self._git('
checkout
', '
origin
/%
s
' % self.branch, '
-
b',
self.branch)
self.branch)
self._git('
update
-
index
', '
--
refresh
') # see note above
self._git('
reset
', '
--
hard
', '
@
{
u
}
')
self._git('
reset
', '
--
merge
', '
@
{
u
}
')
self._git('
clean
', '
-
fdx
')
self.revision = self._git_find_rev(self._git('
rev
-
parse
', '
HEAD
'))
self.revision = self._git_find_rev(self._git('
rev
-
parse
', '
HEAD
'))
elif self.getRepositoryType() == SVN_TYPE:
elif self.getRepositoryType() == SVN_TYPE:
# following code allows sparse checkout
# following code allows sparse checkout
...
...
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