Skip to content
Snippets Groups Projects
Commit 639cc5f5 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

robotpkg-test-rc.py: testing sot-core & sot-dynamic-pinocchio for v2

functionnal changes:
- run `git pull` instead of `git clone` if the directory has already
  been cloned
- add the `category` in the configuration tuple, as pinocchio is in
  `math` and not in `wip`
- run `git submodule update` after branch change

style changes:
- constants can go out of the main class
- make more use of the standard library:
    - argparse to improve cli options
    - logging to define verbosity level
    - pathlib used more, instead of os.path
    - use newer functions from subprocess, instead of Popen
- add `env_join` helper to generate environment variables
- add cli options:
    - robotpkg_root directory
    - -v / --verbose to increment logging level
    - -d / --delete to completely remove robotpkg_root
    - -c / --clean to remove robotpkg_base & work.$HOSTNAME directories
    - --robotpkg_git & --robotpkg_wip_git to use a custom one
    - --conf to append a custom robotpkg.conf file
- use the `get` method of dict to provide a default
- use the `cwd` parameter of subprocess functions instead of using
  os.chdir
- use the `universal_newlines` of subprocess function instead of
  decoding bytes
- use the `with` statement to perform I/O operations
- use the `/` operator to join Path
- remove things related to Bash
- use $ROBOTPKG_BASE instead of $ROBOTPKG_ROOT/install
- actually run the script only `if __name__ == '__main__'`
parent 72829a31
No related branches found
No related tags found
1 merge request!4Update robotpkg-test-rc.py for pinocchio v2.0.0 tests
#!/usr/bin/python3
"""
This script performs a few checkouts on branches on robotpkg, and then tries to compile and test everything
"""
import argparse
import logging
import os
import socket
import subprocess
from pathlib import Path
from shutil import rmtree
# Shell colors
BOLD = '\033[1m'
RED = '\033[1;31m'
GREEN = '\033[1;32m'
PURPLE = '\033[1;35m'
NC = '\033[0m'
# Robotpkg configuration
ACCEPTABLE_LICENSES = [
'openhrp-grx-license', 'cnrs-hpp-closed-source', 'gnu-gpl', 'motion-analysis-license', 'pal-license'
]
PREFER_SYSTEM = [
'gnupg', 'urdfdom', 'urdfdom-headers', 'ros-catkin', 'ros-comm', 'ros-genlisp', 'ros-message-generation',
'ros-std-msgs', 'ros-rospack', 'ros-message-runtime', 'ros-roscpp-core', 'ros-xacro', 'ros-common-msgs',
'ros-lint', 'ros-com-msgs', 'ros-com-msgs', 'bullet', 'ros-ros', 'ros-cmake-modules', 'ros-dynamic-reconfigure',
'ros-realtime-tools', 'ros-control-toolbox', 'ros-bond-core', 'ros-class-loader', 'ros-pluginlib', 'ros-rqt',
'ros-humanoid-msgs', 'ros-genmsg', 'ros-actionlib', 'ros-geometry', 'collada-dom', 'orocos-kdl', 'ros-angles ',
'ros-console-bridge', 'ros-eigen-stl-containers', 'ros-random-numbers', 'ros-resource-retriever',
'ros-shape-tools', 'ros-geometric-shapes', 'ros-srdfdom', 'ros-robot-model', 'ros-orocos-kdl', 'assimp'
]
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('robotpkg_root', nargs='?', type=Path, default=Path.home() / 'devel-src/robotpkg-test-rc')
parser.add_argument('-v', '--verbose', action='count', default=0)
parser.add_argument('-d', '--delete', action='store_true')
parser.add_argument('-c', '--clean', action='store_true')
parser.add_argument('--robotpkg_git', default='https://git.openrobots.org/robots/robotpkg.git')
parser.add_argument('--robotpkg_wip_git', default='ssh://git@git.openrobots.org/robots/robotpkg/robotpkg-wip')
parser.add_argument('--conf', type=Path)
def env_join(base, dirs, old=None):
"""
format an environment variable with <dirs> in <base>, and eventually keep <old> value at the end
"""
paths = [str(Path(base) / path) for path in dirs]
if old is not None:
paths += old.split(':')
return ':'.join(paths)
class RobotpkgTestRC:
def __init__(self, ROBOTPKG_ROOT=None):
""" Init colors and environment variables
Arguments:
ROBOTPKG_ROOT: The directory where the whole robotpkg install takes place.
def __init__(self, robotpkg_root, verbose, delete, clean, robotpkg_git, robotpkg_wip_git, conf):
""" Init environment variables
"""
if ROBOTPKG_ROOT is None:
self.ROBOTPKG_ROOT = str(Path.home()) + '/devel-src/robotpkg-test-rc'
else:
self.ROBOTPKG_ROOT = ROBOTPKG_ROOT
self.init_colors()
self.init_environment_variables(self.ROBOTPKG_ROOT)
self.robotpkg_root = robotpkg_root
self.robotpkg_base = self.robotpkg_root / 'install'
self.delete = delete
self.clean = clean
self.robotpkg_git = robotpkg_git
self.robotpkg_wip_git = robotpkg_wip_git
self.conf = conf
logging.basicConfig(format='%(message)s', level=40 - verbose * 10)
logging.critical('enabled logging of CRITICALs')
logging.error(RED + 'enabled logging of ERRORs' + NC)
logging.warning(PURPLE + 'enabled logging of WARNINGs' + NC)
logging.info(GREEN + 'enabled logging of INFOs' + NC)
logging.debug(BOLD + 'enabled logging of DEBUGs\n' + NC)
self.init_environment_variables()
self.init_robotpkg_conf_add()
self.debug = 0
def init_colors(self):
""" Initialize colors for beautification
The following variables are available:
REG, GREEN, PURPLE, NC (no color)
"""
self.RED = '\033[0;31m'
self.GREEN = '\033[0;32m'
self.PURPLE = '\033[0;35m'
self.NC = '\033[0m'
def init_environment_variables(self, ROBOTPKG_ROOT):
def init_environment_variables(self):
"""Prepare the environment variables.
Specifies the environment when starting bash commands
Specifies the environment when starting commands
"""
self.ROBOTPKG_ROOT = ROBOTPKG_ROOT
self.env = os.environ.copy()
ROBOTPKG_BASE = self.ROBOTPKG_ROOT + '/install'
self.env["ROBOTPKG_BASE"] = ROBOTPKG_BASE
# Imposes bash as the shell
self.env["SHELL"] = "/usr/bin/bash"
self.env["ROBOTPKG_BASE"] = str(self.robotpkg_base)
# For binaries
self.env["PATH"] = ROBOTPKG_BASE+'/sbin:' + \
ROBOTPKG_BASE+'/bin:'+self.env["PATH"]
self.env["PATH"] = env_join(self.robotpkg_base, ['sbin', 'bin'], self.env['PATH'])
# For libraries
prev_LD_LIBRARY_PATH = ''
if "LD_LIBRARY_PATH" in self.env:
prev_LD_LIBRARY_PATH = self.env["LD_LIBRARY_PATH"]
self.env["LD_LIBRARY_PATH"] = ROBOTPKG_BASE+'/lib:' \
+ROBOTPKG_BASE+'/lib/plugin:' \
+ROBOTPKG_BASE+'/lib64:' \
+prev_LD_LIBRARY_PATH
self.env["LD_LIBRARY_PATH"] = env_join(self.robotpkg_base, ['lib', 'lib/plugin', 'lib64'],
self.env.get('LD_LIBRARY_PATH'))
# For python
prev_PYTHON_PATH = ''
if "PYTHON_PATH" in self.env:
prev_PYTHON_PATH = self.env["PYTHON_PATH"]
self.env["PYTHON_PATH"]=ROBOTPKG_BASE+'/lib/python2.7/site-packages:' \
+ROBOTPKG_BASE+'/lib/python2.7/dist-packages:' \
+prev_PYTHON_PATH
self.env["PYTHON_PATH"] = env_join(self.robotpkg_base,
['lib/python2.7/site-packages', 'lib/python2.7/dist-packages'],
self.env.get('PYTHON_PATH', ''))
# For pkgconfig
prev_PKG_CONFIG_PATH = ''
if "PKG_CONFIG_PATH" in self.env:
prev_PKG_CONFIG_PATH = self.env["PKG_CONFIG_PATH"]
self.env["PKG_CONFIG_PATH"]=ROBOTPKG_BASE+'/lib/pkgconfig:' \
+prev_PKG_CONFIG_PATH
self.env["PKG_CONFIG_PATH"] = env_join(self.robotpkg_base, ['lib/pkgconfig'],
self.env.get("PKG_CONFIG_PATH", ''))
# For ros packages
prev_ROS_PACKAGE_PATH = ''
if "ROS_PACKAGE_PATH" in self.env:
prev_ROS_PACKAGE_PATH = self.env["ROS_PACKAGE_PATH"]
self.env["ROS_PACKAGE_PATH"]=ROBOTPKG_BASE+'/share:' \
+ROBOTPKG_BASE+'/stacks' \
+prev_ROS_PACKAGE_PATH
self.env["ROS_PACKAGE_PATH"] = env_join(self.robotpkg_base, ['share', 'stacks'],
self.env.get("ROS_PACKAGE_PATH", ''))
# For cmake
prev_CMAKE_PREFIX_PATH = ''
if "CMAKE_PREFIX_PATH" in self.env:
prev_CMAKE_PREFIX_PATH = self.env["CMAKE_PREFIX_PATH"]
self.env["CMAKE_PREFIX_PATH"] = ROBOTPKG_BASE + ':' + prev_CMAKE_PREFIX_PATH
self.env["CMAKE_PREFIX_PATH"] = str(self.robotpkg_base) + ':' + self.env.get("CMAKE_PREFIX_PATH", '')
def init_robotpkg_conf_add(self):
self.robotpkg_conf_lines = [
'ACCEPTABLE_LICENSES+=openhrp-grx-license', 'ACCEPTABLE_LICENSES+=cnrs-hpp-closed-source',
'ACCEPTABLE_LICENSES+=gnu-gpl', 'ACCEPTABLE_LICENSES+=motion-analysis-license', 'PREFER.gnupg=system',
'PREFER.urdfdom=system', 'PREFER.urdfdom-headers=system', 'PREFER.ros-catkin = system',
'PREFER.ros-comm = system', 'PREFER.ros-genlisp = system', 'PREFER.ros-message-generation = system',
'PREFER.ros-std-msgs = system', 'PREFER.ros-rospack = system', 'PREFER.ros-message-runtime = system',
'PREFER.ros-roscpp-core = system', 'PREFER.ros-xacro = system', 'PREFER.ros-common-msgs = system',
'PREFER.ros-lint = system', 'PREFER.ros-com-msgs = system', 'PREFER.ros-com-msgs = system',
'PREFER.bullet = system', 'PREFER.ros-ros = system', 'PREFER.ros-cmake-modules = system',
'PREFER.ros-dynamic-reconfigure = system', 'PREFER.ros-realtime-tools = system',
'PREFER.ros-control-toolbox = system', 'PREFER.ros-bond-core = system', 'PREFER.ros-class-loader = system',
'PREFER.ros-pluginlib = system', 'PREFER.ros-rqt = system', 'PREFER.ros-humanoid-msgs = system',
'PREFER.ros-genmsg = system', 'PREFER.ros-actionlib = system', 'PREFER.ros-geometry = system',
'PREFER.collada-dom = system', 'PREFER.orocos-kdl = system', 'PREFER.ros-angles = system',
'PREFER.ros-console-bridge = system', 'PREFER.ros-eigen-stl-containers = system',
'PREFER.ros-random-numbers = system', 'PREFER.ros-resource-retriever = system',
'PREFER.ros-shape-tools = system', 'PREFER.ros-geometric-shapes = system', 'PREFER.ros-srdfdom = system',
'PREFER.ros-robot-model = system', 'PREFER.ros-orocos-kdl = system', 'PREFER.assimp=system',
'ACCEPTABLE_LICENSES+=pal-license', 'ROS_PACKAGE_PATH=${ROBOTPKG_ROOT}/install/share:$ROS_PACKAGE_PATH '
]
def execute(self, bashCommand):
""" Execute baschCommand
self.robotpkg_conf_lines = ['ROS_PACKAGE_PATH=${ROBOTPKG_BASE}/share:$ROS_PACKAGE_PATH']
self.robotpkg_conf_lines += ['ACCEPTABLE_LICENSES += %s' % license for licence in ACCEPTABLE_LICENSES]
self.robotpkg_conf_lines += ['PREFER.%s = system' % pkg for pkg in PREFER_SYSTEM]
def execute(self, command, cwd=None):
""" Execute command
Keyword arguments:
bashCommand -- the bashCommand to be run in a bash script
command -- the command to be run
cwd -- the Current Working Directory in which execute the command
It returns a list of binary string that can be iterate
and decode.
"""
# TODO: Handle error
if self.debug > 3:
print("execute bash command: " + bashCommand)
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE, env=self.env)
outputdata, error = process.communicate()
logging.debug(BOLD + "execute command: %s" + NC, command)
outputdata = subprocess.check_output(command.split(), env=self.env, cwd=str(cwd), universal_newlines=True)
for stdout_line in outputdata.splitlines():
print(stdout_line.decode('ascii'))
logging.debug(BOLD + stdout_line + NC)
return outputdata
def prepare_robotpkg(self):
......@@ -135,7 +130,7 @@ class RobotpkgTestRC:
Prepare the robotpkg environment
Make robotpkg directoriers, clone it with wip, bootstrap and add
information in the file ${ROBOTPKG_ROOT}/install/etc/robotpkg.conf
information in the file ${ROBOTPKG_BASE}/etc/robotpkg.conf
"""
self.make_robotpkg_dirs()
self.cloning_robotpkg_main()
......@@ -144,183 +139,183 @@ class RobotpkgTestRC:
self.complete_robotpkg_conffile()
def make_robotpkg_dirs(self):
"""Create directories for robotpkg
ROBOTPKG_ROOT
ROBOTPKG_ROOT/install
"""
print(self.GREEN + 'Creating the repositories' + self.NC)
dirname = self.ROBOTPKG_ROOT + '/'
os.makedirs(dirname, 0o777, True)
dirname = self.ROBOTPKG_ROOT + '/install'
os.makedirs(dirname, 0o777, True)
Create directories for robotpkg
and eventually delete or clean them, depending on the argparser's options
"""
if self.delete and self.robotpkg_root.is_dir():
logging.warning(PURPLE + 'rm -rf %s' % self.robotpkg_root + NC + '\n')
rmtree(str(self.robotpkg_root))
if self.clean:
if self.robotpkg_base.is_dir():
logging.warning(PURPLE + 'rm -rf %s' % self.robotpkg_base + NC + '\n')
rmtree(str(self.robotpkg_base))
logging.info(GREEN + 'Creating the repositories' + NC)
self.robotpkg_base.mkdir(parents=True, exist_ok=True)
def cloning_robotpkg_main(self):
"""Clones the main robotpkg repository"""
print(self.GREEN + 'Cloning robotpkg' + self.NC + '\n')
os.chdir(self.ROBOTPKG_ROOT)
self.execute("git clone https://git.openrobots.org/robots/robotpkg.git")
logging.info(GREEN + 'Cloning robotpkg' + NC + '\n')
if (self.robotpkg_root / 'robotpkg').exists():
self.execute("git pull", cwd=self.robotpkg_root / 'robotpkg')
else:
self.execute("git clone %s" % self.robotpkg_git, cwd=self.robotpkg_root)
def cloning_robotpkg_wip(self):
"""Clones the wip robotpkg repository"""
os.chdir(self.ROBOTPKG_ROOT + '/robotpkg')
print(self.GREEN + 'Cloning robotpkg/wip' + self.NC + '\n')
self.execute("git clone ssh://git@git.openrobots.org/robots/robotpkg/robotpkg-wip wip")
logging.info(GREEN + 'Cloning robotpkg/wip' + NC + '\n')
if (self.robotpkg_root / 'robotpkg/wip').exists():
self.execute("git pull", cwd=self.robotpkg_root / 'robotpkg/wip')
else:
self.execute("git clone %s wip" % self.robotpkg_wip_git, cwd=self.robotpkg_root / 'robotpkg')
def bootstrap_robotpkg(self):
""" bootstrap robotpkg
This method calls:
bootstrap --prefix=${ROBOTPKG_ROOT}/install
bootstrap --prefix=${robotpkg_base}
only if there is no
${ROBOTPKG_ROOT}/install/etc/robotpkg.conf
${robotpkg_base}/etc/robotpkg.conf
already present.
"""
# Test if a file in ROBOTPKG_ROOT/install/etc/robotpkg.conf already exists
rpkg_conf_filename = self.ROBOTPKG_ROOT + '/install/etc/robotpkg.conf'
rpkg_conf_file = Path(rpkg_conf_filename)
# Test if a file in robotpkg_base/etc/robotpkg.conf already exists
rpkg_conf_file = self.robotpkg_base / 'etc/robotpkg.conf'
if rpkg_conf_file.is_file():
print(self.PURPLE + rpkg_conf_filename + self.NC + ' already exists\n')
logging.warning(PURPLE + str(rpkg_conf_file) + NC + ' already exists\n')
return
os.chdir(self.ROBOTPKG_ROOT + '/robotpkg/bootstrap')
print(self.GREEN + 'Boostrap robotpkg' + self.NC + '\n')
self.execute('./bootstrap --prefix=' + self.ROBOTPKG_ROOT + '/install')
logging.info(GREEN + 'Boostrap robotpkg' + NC + '\n')
self.execute('./bootstrap --prefix=%s' % self.robotpkg_base, cwd=self.robotpkg_root / 'robotpkg/bootstrap')
def complete_robotpkg_conffile(self):
"""Add the contents of robotpkg_conf_lines in robotpkg.conf file
Avoid to add two times the same information.
"""
os.chdir(self.ROBOTPKG_ROOT + '/install/etc')
print(self.GREEN + 'Adding information to ' + self.ROBOTPKG_ROOT + '/install/etc/robotpkg.conf\n')
logging.info(GREEN + 'Adding information to ' + str(self.robotpkg_base) + '/etc/robotpkg.conf\n')
# Open the file, read it and stores it in file_robotpkg_contents
file_robotpkgconf = open("robotpkg.conf", 'r')
file_robotpkgconf_contents = file_robotpkgconf.read()
file_robotpkgconf.close()
with (self.robotpkg_base / 'etc/robotpkg.conf').open() as file_robotpkgconf:
file_robotpkgconf_contents = file_robotpkgconf.read()
# Append the optional conf file given as parameter
if self.conf.exists():
with self.conf.open() as f:
file_robotpkgconf_contents += f.read()
# Add new lines at the end of robotpkg.conf file.
file_robotpkgconf = open("robotpkg.conf", 'a')
for stdout_line in self.robotpkg_conf_lines:
if file_robotpkgconf_contents.find(stdout_line) == -1:
file_robotpkgconf.write(stdout_line + '\n')
file_robotpkgconf.close()
def build_rpkg_checkout_package(self, packagename):
''' Execute bashcmd in the working directory of packagename'''
with (self.robotpkg_base / 'etc/robotpkg.conf').open('a') as file_robotpkgconf:
for stdout_line in self.robotpkg_conf_lines:
if file_robotpkgconf_contents.find(stdout_line) == -1:
file_robotpkgconf.write(stdout_line + '\n')
def build_rpkg_checkout_package(self, packagename, category):
''' Execute cmd in the working directory of packagename'''
# Going into the repository directory
hostname = socket.gethostname()
pathname = self.ROBOTPKG_ROOT + '/robotpkg/wip/' + packagename + '/work.' + hostname
pathname = self.robotpkg_root / 'robotpkg' / category / packagename / ('work.' + socket.gethostname())
return pathname
def apply_rpkg_checkout_package(self, packagename, branchname):
def apply_rpkg_checkout_package(self, packagename, branchname, category):
""" Performs a make checkout in packagename directory
packagename: The name of package in which the git clone will be perfomed.
branchname: The name of the branch used in the repository.
category: the category of the package
The location of the repository is specified in the robotpkg Makefile.
"""
print(self.GREEN + 'Checkout ' + packagename + ' in robotpkg/wip' + self.NC + '\n')
logging.info(GREEN + 'Checkout ' + packagename + ' in robotpkg/' + category + NC + '\n')
# Checking if we need to clean or not the package
# First check if the working directory exists
directory_to_clean = True
checkoutdir_packagename = self.build_rpkg_checkout_package(packagename)
checkoutdir_packagename = self.build_rpkg_checkout_package(packagename, category)
if os.path.isdir(checkoutdir_packagename):
if self.debug > 3:
print('Going into :\n' + checkoutdir_packagename)
os.chdir(checkoutdir_packagename)
if checkoutdir_packagename.exists():
logging.debug(BOLD + 'Going into :\n' + str(checkoutdir_packagename) + NC)
# If it does then maybe this is not a git directory
folders = [f.path for f in os.scandir(checkoutdir_packagename) if f.is_dir()]
for folder in folders:
if self.debug > 3:
print("Going into: " + folder)
os.chdir(folder)
for folder in checkoutdir_packagename.iterdir():
if not folder.is_dir():
continue
logging.debug(BOLD + "Going into: %s" % folder + NC)
# Check if there is a git folder
git_folder = folder + '/.git'
if os.path.isdir(git_folder):
if self.debug > 3:
print('Git folder found:')
if (folder / '.git').is_dir():
logging.debug(BOLD + 'Git folder found' + NC)
# Now that we detected a git folder
# Check the branch
outputdata = self.execute("git symbolic-ref --short -q HEAD")
outputdata = self.execute("git symbolic-ref --short -q HEAD", cwd=folder)
for stdout_line in outputdata.splitlines():
lstr = str(stdout_line.decode('ascii'))
if lstr != branchname:
print(self.RED + ' Wrong branch name: ' + lstr + ' instead of ' + branchname + self.NC)
if stdout_line != branchname:
logging.error(RED + ' Wrong branch name: ' + stdout_line + ' instead of ' +
branchname + NC)
else:
finaldirectory = folder
directory_to_clean = False
break
if self.debug > 3:
print('Directory to clean: ' + str(directory_to_clean))
logging.debug(BOLD + 'Directory to clean: ' + str(directory_to_clean) + NC)
if directory_to_clean:
# Going into the directory of the package
os.chdir(self.ROBOTPKG_ROOT + '/robotpkg/wip/' + packagename)
self.execute("make clean confirm")
self.execute("make checkout")
cwd = self.robotpkg_root / 'robotpkg' / category / packagename
self.execute("make clean confirm", cwd=cwd)
self.execute("make checkout", cwd=cwd)
else:
os.chdir(finaldirectory)
# Remove all the files which may have been modified.
self.execute("git reset --hard")
self.execute("git reset --hard", cwd=finaldirectory)
# Pull all the modification push upstream.
self.execute("git pull origin " + branchname + ':' + branchname)
self.execute("git pull origin " + branchname + ':' + branchname, cwd=finaldirectory)
def apply_git_checkout_branch(self, packagename, branchname):
def apply_git_checkout_branch(self, packagename, branchname, category):
"""
Changes the branch of a git repository in robotpkg.
The method first detects that the package working directory is
really a git repository. Then it performs the branch switch.
"""
bashcmd = 'git checkout ' + branchname
checkoutdir_packagename = self.build_rpkg_checkout_package(packagename)
folders = [f.path for f in os.scandir(checkoutdir_packagename) if f.is_dir()]
for folder in folders:
if self.debug > 3:
print("Going into: " + folder)
os.chdir(folder)
git_folder = folder + '/.git'
if os.path.isdir(git_folder):
self.execute(bashcmd)
def compile_package(self, packagename):
checkoutdir_packagename = self.build_rpkg_checkout_package(packagename, category)
for folder in checkoutdir_packagename.iterdir():
if not folder.is_dir():
continue
logging.debug(BOLD + "Going into: %s" % folder + NC)
if (folder / '.git').is_dir():
self.execute('git checkout ' + branchname, cwd=folder)
self.execute('git submodule update', cwd=folder)
def compile_package(self, packagename, category):
""" Performs make replace confirm in package working directory
"""
# Going into the directory of the package
os.chdir(self.ROBOTPKG_ROOT + '/robotpkg/wip/' + packagename)
print(self.GREEN + 'Compile ' + packagename + ' in robotpkg/wip' + self.NC + '\n')
logging.info(GREEN + 'Compile ' + packagename + ' in robotpkg/' + category + NC + '\n')
# Compiling the repository
self.execute("make replace confirm")
self.execute("make replace confirm", cwd=self.robotpkg_root / 'robotpkg' / category / packagename)
def handle_package(self, packagename, branchname):
def handle_package(self, packagename, branchname, category):
"""Compile and install packagename with branch branchname
First performs the proper make checkout and git operation to get the branch
Then compile the package with make replace.
Do not use make update confirm, this install the release version (the tar file).
"""
self.apply_rpkg_checkout_package(packagename, branchname)
self.apply_git_checkout_branch(packagename, branchname)
self.compile_package(packagename)
self.apply_rpkg_checkout_package(packagename, branchname, category)
self.apply_git_checkout_branch(packagename, branchname, category)
self.compile_package(packagename, category)
def perform_test(self, arch_release_candidates):
"""Install packages specifued by release_candidates
arch_release_candidates: tuple of pair [ ('package_name','branch_name'), ... ]
arch_release_candidates: tuple of triples [ ('category', 'package_name','branch_name'), ... ]
"""
self.prepare_robotpkg()
for package_name, branch_name in arch_release_candidates:
self.handle_package(package_name, branch_name)
for category, package_name, branch_name in arch_release_candidates:
self.handle_package(package_name, branch_name, category)
arch_release_candidates = [('dynamic-graph-v3', 'devel'), ('py-dynamic-graph-v3', 'devel'),
('sot-core-v3', 'rc-v3.3.0'), ('py-sot-core-v3', 'rc-v3.3.0'), ('sot-dyninv-v3', 'master'),
('py-sot-dyninv-v3', 'master'), ('sot-dynamic-pinocchio-v3', 'rc-v3.2.4'),
('py-sot-dynamic-pinocchio-v3', 'rc-v3.2.4'), ('roscontrol-sot', 'master')]
arch_release_candidates = [
('math', 'pinocchio', 'devel'),
('math', 'py-pinocchio', 'devel'),
('wip', 'sot-core-v3', 'topic/pinocchio_v2'),
('wip', 'sot-dynamic-pinocchio-v3', 'topic/pinocchio_v2'),
]
arpgtestrc = RobotpkgTestRC()
arpgtestrc.perform_test(arch_release_candidates)
if __name__ == '__main__':
RobotpkgTestRC(**vars(parser.parse_args())).perform_test(arch_release_candidates)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment