Skip to content

Commit c466b25

Browse files
committed
PR feedback
1 parent d0c6a85 commit c466b25

9 files changed

+45
-53
lines changed

.travis.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,14 @@ matrix:
5757
# install colcon for test results
5858
- pip install colcon-core colcon-test-result
5959
- python setup.py install
60-
- mkdir -p job_under job_over/underlay
61-
- ln -s .. job_under/ros_buildfarm
62-
- ln -s .. job_over/ros_buildfarm
60+
- mkdir job job/underlay && cd job
61+
- ln -s .. ros_buildfarm
6362
script:
64-
- cd job_under
65-
- generate_ci_script.py $CONFIG2_URL $ROS2_DISTRO_NAME default $OS_NAME $OS_CODE_NAME2 $ARCH --packages-select $UNDERLAY_PACKAGES --depth-before 100 > job_under.sh
66-
- (. job_under.sh -y; exit $test_result_RC)
67-
- cd ../job_over
68-
- tar -xjf ../job_under/ros2-$ROS2_DISTRO_NAME-linux-$OS_CODE_NAME2-$ARCH-ci.tar.bz2 -C underlay
69-
- generate_ci_script.py $CONFIG2_URL $ROS2_DISTRO_NAME default $OS_NAME $OS_CODE_NAME2 $ARCH --packages-select $OVERLAY_PACKAGES --depth-before 100 --build-ignore $UNDERLAY_PACKAGES --underlay-source-path underlay/ros2-linux > job_over.sh
70-
- (. job_over.sh -y; exit $test_result_RC)
63+
- generate_ci_script.py $CONFIG2_URL $ROS2_DISTRO_NAME default $OS_NAME $OS_CODE_NAME2 $ARCH --packages-select $UNDERLAY_PACKAGES --depth-before 100 > job.sh
64+
- (. job.sh -y; exit $test_result_RC)
65+
- tar -xjf ros2-$ROS2_DISTRO_NAME-linux-$OS_CODE_NAME2-$ARCH-ci.tar.bz2 -C underlay
66+
- generate_ci_script.py $CONFIG2_URL $ROS2_DISTRO_NAME default $OS_NAME $OS_CODE_NAME2 $ARCH --packages-select $OVERLAY_PACKAGES --depth-before 100 --build-ignore $UNDERLAY_PACKAGES --underlay-source-path underlay/ros2-linux > job.sh
67+
- (. job.sh -y; exit $test_result_RC)
7168
- language: python
7269
python: "3.6"
7370
sudo: required

doc/configuration_options.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ The following options are valid as keys in the ``_config`` dict under
393393
20-default.list file from your forked rosdistro repository.
394394

395395
Specific options in CI build files
396-
---------------------------------------
396+
----------------------------------
397397

398398
This yaml file defines the configuration for *CI* jobs.
399399

@@ -404,16 +404,18 @@ The file format is specified by the following information:
404404

405405
The following options are valid in version ``1`` (beside the generic options):
406406

407-
* ``build_tool``: the build tool to use. The following are valid values:
407+
* ``build_tool``: the build tool to use.
408+
The following are valid values:
408409

409410
* ``catkin_make_isolated`` (default)
410411
* ``colcon``
411412

412413
* ``foundation_packages``: a list of packages which should be installed by
413414
default before any of the dependencies necessary to build the packages in the
414-
workspace. Since not all packages in the workspace are necessarily ROS
415-
packages, rosdep may be unable to detect and install the prerequisites for
416-
those packages, so those prerequisite packages may need to be listed here.
415+
workspace.
416+
Since not all packages in the workspace are necessarily ROS packages, rosdep
417+
may be unable to detect and install the prerequisites for those packages, so
418+
those prerequisite packages may need to be listed here.
417419

418420
* ``jenkins_job_priority``: the job priority of *CI* jobs.
419421

doc/jobs/ci_jobs.rst

+17-17
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ It generates three Dockerfiles: one to perform the *create-workspace* task to
4444
populate the workspace and enumerate prerequisites, one to perform the
4545
*build-and-install* task, and one to perform the *build-and-test* task.
4646

47-
A typical job runs 4 Dockerfiles in all.
48-
4947
Create workspace
5048
^^^^^^^^^^^^^^^^
5149

@@ -56,7 +54,7 @@ The task performs the following steps:
5654

5755
* Prepare the package sources
5856

59-
* Fetches the `.repos` file(s)
57+
* Fetches the ``.repos`` file(s)
6058
* Fetches the source repositories containing the package(s) to be built
6159
* If necessary, switches the branch in those repositories
6260

@@ -86,11 +84,11 @@ Known limitations
8684
^^^^^^^^^^^^^^^^^
8785

8886
System dependency enumeration happens for all ROS packages that are part of the
89-
non-underlay workspace. This means that any non-ROS packages present in that
90-
workspace may need their dependencies explicitly called out for inclusion in
91-
the foundation package list, and also means that a missing dependency may be
92-
occluded by another package in the workspace correctly declaring the same
93-
dependency.
87+
non-underlay workspace.
88+
This means that any non-ROS packages present in that workspace may need their
89+
dependencies explicitly called out for inclusion in the foundation package list,
90+
and also means that a missing dependency may be occluded by another package in
91+
the workspace correctly declaring the same dependency.
9492

9593
Run the *CI* job locally
9694
------------------------
@@ -111,10 +109,10 @@ from ROS *Crystal* for Ubuntu *Bionic* *amd64*:
111109
Return code
112110
-----------
113111

114-
The return code of the generated script will be zero if it successfully performed
115-
the build and ran the test even if some tests failed. By setting the environment
116-
variable `ABORT_ON_TEST_FAILURE=1` the return code will also be non-zero in case
117-
of failed tests.
112+
The return code of the generated script will be zero if it successfully
113+
performed the build and ran the test even if some tests failed.
114+
By setting the environment variable ``ABORT_ON_TEST_FAILURE=1`` the return code
115+
will also be non-zero in case of failed tests.
118116

119117
Instead of invoking the generated script it can also be *sourced*:
120118

@@ -127,12 +125,13 @@ The return code of the invocation of ``catkin_tests_results`` /
127125
``test_result_RC``.
128126

129127
Run the *CI* job on Travis
130-
-----------------------------
128+
--------------------------
131129

132130
Since it is easy to run a *CI* job locally it can also be run on Travis to
133-
either test every commit or pull request. The setup and invocation is the same
134-
as locally. The following .travis.yml template is a good starting point and is
135-
ready to be use:
131+
either test every commit or pull request.
132+
The setup and invocation is the same as locally.
133+
The following .travis.yml template is a good starting point and is ready to be
134+
used:
136135

137136
.. code:: yaml
138137
@@ -179,7 +178,8 @@ ready to be use:
179178
notifications:
180179
email: false
181180
182-
An example can be found in the `.travis.yml <https://github.com/ros-infrastructure/ros_buildfarm/blob/master/.travis.yml>`_ file of the *ros_buildfarm* repository.
181+
An example can be found in the `.travis.yml <https://github.com/ros-infrastructure/ros_buildfarm/blob/master/.travis.yml>`_
182+
file of the *ros_buildfarm* repository.
183183

184184
Run for "custom" repositories
185185
-----------------------------

ros_buildfarm/argument.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ class CheckLength(argparse.Action):
304304
def __call__(self, parser, args, values, option_string=None):
305305
if len(values) < minargs:
306306
raise argparse.ArgumentError(
307-
argument=self,
308-
message="expected at least %s arguments" % (minargs))
307+
argument=self,
308+
message='expected at least %s arguments' % (minargs))
309309
elif len(values) > maxargs:
310310
raise argparse.ArgumentError(
311-
argument=self,
312-
message="expected at most %s arguments" % (minargs))
311+
argument=self,
312+
message='expected at most %s arguments' % (minargs))
313313
setattr(args, self.dest, values)
314314
return CheckLength

ros_buildfarm/ci_job.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def configure_ci_job(
205205

206206
job_config = _get_ci_job_config(
207207
index, rosdistro_name, build_file, os_name,
208-
os_code_name, arch, job_name,
208+
os_code_name, arch,
209209
build_file.repos_files,
210210
underlay_source_job,
211211
underlay_source_paths,
@@ -228,7 +228,7 @@ def configure_ci_view(jenkins, view_name, dry_run=False):
228228

229229
def _get_ci_job_config(
230230
index, rosdistro_name, build_file, os_name,
231-
os_code_name, arch, job_name,
231+
os_code_name, arch,
232232
repos_files, underlay_source_job,
233233
underlay_source_paths, trigger_timer,
234234
is_disabled=False):
@@ -260,9 +260,6 @@ def _get_ci_job_config(
260260

261261
'disabled': is_disabled,
262262

263-
# this should not be necessary
264-
'job_name': job_name,
265-
266263
'ros_buildfarm_repository': get_repository(),
267264

268265
'script_generating_key_files': script_generating_key_files,

ros_buildfarm/templates/ci/ci_job.xml.em

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ parameters = [
164164
' ' + ' '.join(repository_args) +
165165
' --build-tool ' + build_tool +
166166
' --ros-version ' + str(ros_version) +
167-
' --env-vars ' + ' '.join(build_environment_variables) +
167+
' --env-vars ' + ' '.join([v.replace('$', '\\$',) for v in build_environment_variables]) +
168168
' --dockerfile-dir $WORKSPACE/docker_generating_dockers' +
169169
' --repos-file-urls $repos_files' +
170170
' --test-branch "$test_branch"' +

scripts/ci/build_task_generator.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ def main(argv=sys.argv[1:]):
7979

8080
apt_cache = Cache()
8181

82-
debian_pkg_names = set(args.foundation_packages)
82+
debian_pkg_names = set(['build-essential'])
83+
debian_pkg_names.update(args.foundation_packages)
8384
if args.build_tool == 'colcon':
84-
debian_pkg_names |= set([
85+
debian_pkg_names.update([
8586
'python3-catkin-pkg-modules',
8687
'python3-colcon-ros',
8788
'python3-colcon-test-result',

scripts/ci/create_workspace_task_generator.py

-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ def main(argv=sys.argv[1:]):
140140
create_dockerfile(
141141
'ci/create_workspace.Dockerfile.em', data, args.dockerfile_dir)
142142

143-
# output hints about necessary volumes to mount
144-
ros_buildfarm_basepath = os.path.normpath(
145-
os.path.join(os.path.dirname(__file__), '..', '..'))
146-
147143

148144
if __name__ == '__main__':
149145
main()

scripts/devel/build_and_test.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ def main(argv=sys.argv[1:]):
6767
with Scope('SUBSECTION', 'build workspace in isolation'):
6868
test_results_dir = os.path.join(
6969
args.workspace_root, 'test_results')
70-
cmake_args = ['-DBUILD_TESTING=1']
70+
cmake_args = [
71+
'-DBUILD_TESTING=1'
72+
'-DCATKIN_ENABLE_TESTING=1', '-DCATKIN_SKIP_TESTING=0',
73+
'-DCATKIN_TEST_RESULTS_DIR=%s' % test_results_dir]
7174
additional_args = None
7275
if args.build_tool == 'colcon':
7376
additional_args = ['--test-result-base', test_results_dir]
74-
elif args.build_tool == 'catkin_make_isolated':
75-
cmake_args += [
76-
'-DCATKIN_ENABLE_TESTING=1', '-DCATKIN_SKIP_TESTING=0',
77-
'-DCATKIN_TEST_RESULTS_DIR=%s' % test_results_dir]
7877
env = dict(os.environ)
7978
env['MAKEFLAGS'] = '-j1'
8079
rc = call_build_tool(

0 commit comments

Comments
 (0)