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
Léo-Paul Géneau
erp5
Commits
923dc677
Commit
923dc677
authored
May 11, 2011
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to test a particular branch
parent
56686a2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
slapos/recipe/erp5.recipe.testnode/setup.py
slapos/recipe/erp5.recipe.testnode/setup.py
+1
-1
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
...cipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
+2
-1
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/__init__.py
...erp5.recipe.testnode/src/erp5/recipe/testnode/__init__.py
+2
-0
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
...erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
+20
-13
No files found.
slapos/recipe/erp5.recipe.testnode/setup.py
View file @
923dc677
from
setuptools
import
setup
,
find_packages
name
=
"erp5.recipe.testnode"
version
=
'1.0'
version
=
'1.0
.5
'
def
read
(
name
):
return
open
(
name
).
read
()
...
...
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/SlapOSControler.py
View file @
923dc677
...
...
@@ -47,11 +47,12 @@ class SlapOSControler(object):
'reference'
:
config
[
'computer_id'
],
'software_root'
:
config
[
'software_root'
]}))
def
runSoftwareRelease
(
self
,
config
,
process_group_pid_list
=
None
):
def
runSoftwareRelease
(
self
,
config
,
environment
,
process_group_pid_list
=
None
):
print
"SlapOSControler.runSoftwareRelease"
while
True
:
cpu_count
=
os
.
sysconf
(
"SC_NPROCESSORS_ONLN"
)
os
.
putenv
(
'MAKEFLAGS'
,
'-j%s'
%
cpu_count
)
os
.
environ
[
'PATH'
]
=
environment
[
'PATH'
]
slapgrid
=
subprocess
.
Popen
([
config
[
'slapgrid_software_binary'
],
'-v'
,
'-c'
,
#'--buildout-parameter',"'-U -N' -o",
config
[
'slapos_config'
]],
...
...
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/__init__.py
View file @
923dc677
...
...
@@ -85,6 +85,7 @@ class Recipe(BaseSlapRecipe):
working_directory
=
CONFIG
[
'working_directory'
],
vcs_repository
=
self
.
parameter_dict
.
get
(
'vcs_repository'
),
node_quantity
=
self
.
parameter_dict
.
get
(
'node_quantity'
,
'1'
),
branch
=
self
.
parameter_dict
.
get
(
'branch'
,
None
),
test_suite_master_url
=
self
.
parameter_dict
.
get
(
'test_suite_master_url'
,
None
),
test_suite_name
=
self
.
parameter_dict
.
get
(
'test_suite_name'
),
...
...
@@ -96,6 +97,7 @@ class Recipe(BaseSlapRecipe):
# environment of running bot
bot_environment
=
self
.
parameter_dict
.
get
(
'bot_environment'
,
''
),
partition_reference
=
CONFIG
[
'partition_reference'
],
environment
=
dict
(
PATH
=
os
.
environ
[
'PATH'
]),
)
]))
...
...
slapos/recipe/erp5.recipe.testnode/src/erp5/recipe/testnode/testnode.py
View file @
923dc677
...
...
@@ -59,6 +59,7 @@ slapos_controler = None
def
run
(
args
):
config
=
args
[
0
]
slapgrid
=
None
branch
=
config
.
get
(
'branch'
,
None
)
supervisord_pid_file
=
os
.
path
.
join
(
config
[
'instance_root'
],
'var'
,
'run'
,
'supervisord.pid'
)
subprocess
.
check_call
([
config
[
'git_binary'
],
...
...
@@ -74,27 +75,33 @@ def run(args):
# Write our own software.cfg to use the local repository
custom_profile_path
=
os
.
path
.
join
(
config
[
'working_directory'
],
'software.cfg'
)
config
[
'custom_profile_path'
]
=
custom_profile_path
if
not
os
.
path
.
exists
(
custom_profile_path
):
# create a profile in order to use the repository we already have
custom_profile
=
open
(
custom_profile_path
,
'w'
)
profile_content
=
"""
# create a profile in order to use the repository we already have
custom_profile
=
open
(
custom_profile_path
,
'w'
)
profile_content
=
"""
[buildout]
extends = %(software_config_path)s
[%(repository_name)s
_repository
]
[%(repository_name)s]
repository = %(repository_path)s
"""
%
{
'software_config_path'
:
os
.
path
.
join
(
repository_path
,
config
[
'profile_url'
]),
'repository_name'
:
repository_name
,
'repository_path'
:
repository_path
}
custom_profile
.
write
(
profile_content
)
custom_profile
.
close
()
config
[
'profile_url'
]),
'repository_name'
:
repository_name
,
'repository_path'
:
repository_path
}
if
branch
is
not
None
:
profile_content
+=
"
\
n
branch = %s"
%
branch
custom_profile
.
write
(
profile_content
)
custom_profile
.
close
()
try
:
while
True
:
# Make sure we have local repository
if
not
os
.
path
.
exists
(
repository_path
):
subprocess
.
check_call
([
config
[
'git_binary'
],
'clone'
,
config
[
'vcs_repository'
],
repository_path
])
parameter_list
=
[
config
[
'git_binary'
],
'clone'
,
config
[
'vcs_repository'
]]
if
branch
is
not
None
:
parameter_list
.
extend
([
'-b'
,
branch
])
parameter_list
.
append
(
repository_path
)
subprocess
.
check_call
(
parameter_list
)
# XXX this looks like to not wait the end of the command
# Make sure we have local repository
updater
=
Updater
(
repository_path
,
git_binary
=
config
[
'git_binary'
])
...
...
@@ -105,7 +112,6 @@ repository = %(repository_path)s
continue
previous_revision
=
revision
print
config
portal_url
=
config
[
'test_suite_master_url'
]
test_result_path
=
None
...
...
@@ -137,6 +143,7 @@ repository = %(repository_path)s
if
run_software
:
# this should be always true later, but it is too slow for now
slapos_controler
.
runSoftwareRelease
(
config
,
environment
=
config
[
'environment'
],
process_group_pid_list
=
process_group_pid_list
,
)
run_software
=
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