Skip to content

Commit

Permalink
Add feature flag to drop dependencies from test execution (#571)
Browse files Browse the repository at this point in the history
The current model requires that packages have already finished building
prior to invoking tests, meaning that there aren't any ordering
constraints on test execution.
  • Loading branch information
cottsay authored Jun 13, 2024
1 parent ca9583e commit cc1eadd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion colcon_core/verb/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from colcon_core.executor import execute_jobs
from colcon_core.executor import Job
from colcon_core.executor import OnError
from colcon_core.feature_flags import is_feature_flag_set
from colcon_core.logging import colcon_logger
from colcon_core.package_selection import add_arguments \
as add_packages_arguments
Expand Down Expand Up @@ -181,6 +182,7 @@ def put_event_into_queue_(self, event):

def _get_jobs(self, args, decorators, install_base):
jobs = OrderedDict()
drop_test_deps = is_feature_flag_set('drop_test_deps')
for decorator in decorators:
if not decorator.selected:
continue
Expand Down Expand Up @@ -216,7 +218,9 @@ def _get_jobs(self, args, decorators, install_base):

job = Job(
identifier=pkg.name,
dependencies=set(recursive_dependencies.keys()),
dependencies=set(
() if drop_test_deps else recursive_dependencies.keys()
),
task=extension, task_context=task_context)

jobs[pkg.name] = job
Expand Down

0 comments on commit cc1eadd

Please sign in to comment.