Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

ensure exec dependencies are sourced when testing - #86

Merged
wjwwood merged 1 commit into
masterfrom
multiple-vendors
Apr 1, 2016
Merged

wjwwood merged 1 commit into
masterfrom
multiple-vendors

Conversation

@wjwwood

@wjwwood wjwwood commented Mar 31, 2016

Copy link
Copy Markdown
Contributor

This came up when I removed the unnecessary test_depend on ament_index_python after a discussion here: ros2/rclpy#5 (comment)

I believe this is the correct course of action for now. Basically every step of the build process (build, test, install, uninstall) can produce a "prefix" file which is a shell script which is placed before the command being run (make, ctest, msbuild, whatever) that can source setup files from other packages. Right now, all of these files will try to source the package specific local setup file for each package which comes before it in topological order (basically that packages direct build/test/buildtool dependencies and the recursive run dependencies of those direct dependencies). Because of this, dependencies which are listed as an exec depend only (not also a build/buildtool/exec depend) would not be sourced before running tests because it would not make into the test prefix file (usually named cmake__test.{sh|bat}).

This pull request extends what was already being added by including the exec depends of the package being tested. Some of these dependencies may not be packages in the repository, but all source lines are guarded by an "if-exists-then-source" type of logic, so it's ok.

Connects to ros2/rclpy#5

@wjwwood wjwwood added the in progress Actively being worked on (Kanban column) label Mar 31, 2016
@dirk-thomas

Copy link
Copy Markdown
Contributor

Do I read the patch correctly that the exec_dependency_paths are always added to the context and therefore affect every action of the verb? Wouldn't that imply that its exec dependencies are being sourced even when a package is being build?

@wjwwood

wjwwood commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

No that is not correct. It is only added to the test file.

@dirk-thomas

Copy link
Copy Markdown
Contributor

Oh I see. It only happens in the on_test functions.

@dirk-thomas

Copy link
Copy Markdown
Contributor

As you mentioned the current patch uses all exec dependencies without considering if they are in the workspace. I think this should be changed and checked before hand and not rely on the shell script to to the file existence check.

@wjwwood

wjwwood commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

I'll see if I can change it to do that.

@wjwwood

wjwwood commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

I think 1d90d70 will accomplish that (I tested it locally and it works). I'll run CI over all of these things once I have followed up on everything.

Comment thread ament_tools/verbs/build/cli.py Outdated
opts.skip_packages = opts.skip_packages or []
install_space_base = opts.install_space
package_dict = dict([(path, package) for path, package, _ in packages])
workspace_package_names = sorted([pkg.name for pkg in package_dict.values()])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorted isn't necessary since the result isn't used for a loop. For performance reasons I would suggest to remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I removed it: 24a53fe

@dirk-thomas

Copy link
Copy Markdown
Contributor

LGTM.

@wjwwood
wjwwood merged commit 600cb1d into master Apr 1, 2016
@wjwwood
wjwwood deleted the multiple-vendors branch April 1, 2016 18:39
@wjwwood wjwwood removed the in progress Actively being worked on (Kanban column) label Apr 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants