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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
645fb1e4
Commit
645fb1e4
authored
Jul 16, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: Use revision for scalability case
parent
b663f40b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+26
-7
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+21
-4
No files found.
erp5/tests/testERP5TestNode.py
View file @
645fb1e4
...
...
@@ -209,15 +209,19 @@ class ERP5TestNode(TestCase):
def
test_04_constructProfile
(
self
,
my_test_type
=
'UnitTest'
):
"""
Check if the software profile is correctly generated
"""
"""
test_node
=
self
.
getTestNode
()
test_node
.
test_suite_portal
=
TaskDistributor
test_node
.
test_suite_portal
.
getTestNode
=
TaskDistributor
.
getTestType
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
self
.
updateNodeTestSuiteData
(
node_test_suite
,
add_third_repository
=
True
)
test_node
.
constructProfile
(
node_test_suite
)
node_test_suite
.
revision
=
'rep1=1234-azerty,rep2=3456-qwerty'
test_node
.
constructProfile
(
node_test_suite
,
my_test_type
)
self
.
assertEquals
(
"%s/software.cfg"
%
(
node_test_suite
.
working_directory
,),
node_test_suite
.
custom_profile_path
)
profile
=
open
(
node_test_suite
.
custom_profile_path
,
'r'
)
expected_profile
=
"""
if
my_test_type
==
'UnitTest'
:
expected_profile
=
"""
[buildout]
extends = %(temp_dir)s/testnode/foo/rep0/software.cfg
...
...
@@ -229,6 +233,21 @@ branch = master
repository = %(temp_dir)s/testnode/foo/rep2
branch = foo
"""
%
{
'temp_dir'
:
self
.
_temp_dir
}
else
:
revision1
=
"azerty"
revision2
=
"qwerty"
expected_profile
=
"""
[buildout]
extends = %(temp_dir)s/testnode/foo/rep0/software.cfg
[rep1]
revision = %(revision1)s
branch =
[rep2]
revision = %(revision2)s
branch =
"""
%
{
'temp_dir'
:
self
.
_temp_dir
,
'revision1'
:
revision1
,
'revision2'
:
revision2
}
self
.
assertEquals
(
expected_profile
,
profile
.
read
())
profile
.
close
()
...
...
@@ -726,7 +745,7 @@ branch = foo
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
SlapOSControler
.
_
updateInstanceXML
=
original_updateInstanceXML
SlapOSControler
.
updateInstanceXML
=
original_updateInstanceXML
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
...
@@ -921,7 +940,7 @@ branch = foo
original_runTestSuite
=
RunnerClass
.
runTestSuite
original_supply
=
SlapOSControler
.
supply
original_request
=
SlapOSControler
.
request
original_updateInstanceXML
=
SlapOSControler
.
_
updateInstanceXML
original_updateInstanceXML
=
SlapOSControler
.
updateInstanceXML
#
time
.
sleep
=
doNothing
...
...
@@ -937,7 +956,7 @@ branch = foo
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
SlapOSControler
.
_
updateInstanceXML
=
doNothing
SlapOSControler
.
updateInstanceXML
=
doNothing
# Run
test_node
=
self
.
getTestNode
()
test_node
.
run
()
...
...
@@ -954,5 +973,5 @@ branch = foo
RunnerClass
.
runTestSuite
=
original_runTestSuite
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
SlapOSControler
.
_
updateInstanceXML
=
original_updateInstanceXML
SlapOSControler
.
updateInstanceXML
=
original_updateInstanceXML
time
.
sleep
=
original_sleep
erp5/util/testnode/testnode.py
View file @
645fb1e4
...
...
@@ -113,7 +113,7 @@ class TestNode(object):
invocation_list
=
line
[
2
:].
split
()
return
invocation_list
def
constructProfile
(
self
,
node_test_suite
,
use_relative_path
=
False
):
def
constructProfile
(
self
,
node_test_suite
,
test_type
,
use_relative_path
=
False
):
config
=
self
.
config
profile_content
=
''
assert
len
(
node_test_suite
.
vcs_repository_list
),
"we must have at least one repository"
...
...
@@ -153,7 +153,24 @@ extends = %(software_config_path)s
node_test_suite
.
reference
)
repository_path
=
os
.
path
.
relpath
(
repository_path
,
from_path
)
profile_content_list
.
append
(
"""
if
test_type
==
"ScalabilityTest"
:
# updater = Updater(repository_path, git_binary=self.config['git_binary'],
# branch = vcs_repository.get('branch','master'), log=self.log, process_manager=self.process_manager)
# updater.checkout()
# revision = updater.getRevision()[1]
all_revision
=
node_test_suite
.
revision
# from 'sec1=xx-azer,sec2=yy-qwer,..' to [[sec1,azer],[sec2,qwer],..]
revision_list
=
[
[
x
.
split
(
'='
)[
0
],
x
.
split
(
'='
)[
1
].
split
(
'-'
)[
1
]]
for
x
in
all_revision
.
split
(
','
)
]
# from [[sec1,azer],[sec2,qwer],..] to {sec1:azer,sec2:qwer,..}
revision_dict
=
{
branch
:
revision
for
branch
,
revision
in
revision_list
}
profile_content_list
.
append
(
"""
[%(buildout_section_id)s]
revision = %(revision)s
branch =
"""
%
{
'buildout_section_id'
:
buildout_section_id
,
'revision'
:
revision_dict
[
buildout_section_id
]})
else
:
profile_content_list
.
append
(
"""
[%(buildout_section_id)s]
repository = %(repository_path)s
branch = %(branch)s
...
...
@@ -345,11 +362,11 @@ from the distributor.")
log_directory
=
self
.
config
[
'log_directory'
])
node_test_suite
.
edit
(
**
test_suite
)
run_software
=
True
# Write our own software.cfg to use the local repository
self
.
constructProfile
(
node_test_suite
,
runner
.
getRelativePathUsage
())
# kill processes from previous loop if any
self
.
process_manager
.
killPreviousRun
()
self
.
getAndUpdateFullRevisionList
(
node_test_suite
)
# Write our own software.cfg to use the local repository
self
.
constructProfile
(
node_test_suite
,
my_test_type
,
runner
.
getRelativePathUsage
())
# Make sure we have local repository
test_result
=
portal
.
createTestResult
(
node_test_suite
.
revision
,
[],
config
[
'test_node_title'
],
False
,
...
...
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