Skip to content

Commit

Permalink
Revert "jobs: Fixing environment required to run catkin test targets …
Browse files Browse the repository at this point in the history
…on pre-indigo catkin" (#600)

This reverts commit 050de44 and partially c5daf4a.
  • Loading branch information
meyerj authored May 22, 2020
1 parent f51a671 commit 5fc3a5d
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions catkin_tools/jobs/catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,6 @@ def link_devel_products(
return 0


def ctr_nuke(logger, event_queue, prefix):
"""Adds an env-hook which clears the catkin and ros test results dir."""

ctr_nuke_path = os.path.join(prefix, 'etc', 'catkin', 'profile.d')
ctr_nuke_filename = os.path.join(ctr_nuke_path, '06-ctr-nuke.sh')
mkdir_p(ctr_nuke_path)
if not os.path.exists(ctr_nuke_filename):
with open(ctr_nuke_filename, 'w') as ctr_nuke_file:
ctr_nuke_file.write(CTR_NUKE_SH)
return 0


def create_catkin_build_job(context, package, package_path, dependencies, force_cmake, pre_clean, prebuild=False):
"""Job class for building catkin packages"""

Expand Down Expand Up @@ -410,30 +398,12 @@ def create_catkin_build_job(context, package, package_path, dependencies, force_
dest_path=os.path.join(metadata_path, 'package.xml')
))

# Define test results directory
catkin_test_results_dir = os.path.join(build_space, 'test_results')
# Always override the CATKIN and ROS _TEST_RESULTS_DIR environment variables.
# This is in order to avoid cross talk due to parallel builds.
# This is only needed for ROS Hydro and earlier (the problem was addressed upstream in Indigo).
# See: https://github.com/catkin/catkin_tools/issues/139
ctr_env = {
'CATKIN_TEST_RESULTS_DIR': catkin_test_results_dir,
'ROS_TEST_RESULTS_DIR': catkin_test_results_dir
}

# Only run CMake if the Makefile doesn't exist or if --force-cmake is given
# TODO: This would need to be different with `cmake --build`
makefile_path = os.path.join(build_space, 'Makefile')

if not os.path.isfile(makefile_path) or force_cmake:

# Create an env-hook which clears the catkin and ros test results environment variable.
stages.append(FunctionStage(
'ctr-nuke',
ctr_nuke,
prefix=context.package_dest_path(package)
))

require_command('cmake', CMAKE_EXEC)

# CMake command
Expand Down Expand Up @@ -465,9 +435,6 @@ def create_catkin_build_job(context, package, package_path, dependencies, force_
context.make_args +
context.catkin_make_args)

# Determine if the catkin test results env needs to be overridden
env_overrides = ctr_env if 'test' in make_args else {}

# Pre-clean command
if pre_clean:
# TODO: Remove target args from `make_args`
Expand All @@ -484,7 +451,6 @@ def create_catkin_build_job(context, package, package_path, dependencies, force_
'make',
[MAKE_EXEC] + make_args,
cwd=build_space,
env_overrides=env_overrides,
logger_factory=CMakeMakeIOBufferProtocol.factory
))

Expand Down Expand Up @@ -618,12 +584,6 @@ def create_catkin_clean_job(
)


CTR_NUKE_SH = """\
#!/usr/bin/env sh
unset CATKIN_TEST_RESULTS_DIR
unset ROS_TEST_RESULTS_DIR
"""

DEVEL_MANIFEST_FILENAME = 'devel_manifest.txt'

# List of files which shouldn't be copied
Expand Down

0 comments on commit 5fc3a5d

Please sign in to comment.