Skip to content

Uses python-coverage (Python 2) on Noetic #26

@StefanFabian

Description

@StefanFabian

Thank you for this ROS wrapper, I have used it for quite some time now on kinetic and melodic.
Unfortunately, it doesn't work on my Travis CI for noetic anymore for the following reason:
While the package correctly depends on python3-coverage for $ROS_PYTHON_VERSION==3, the command used is still python-coverage regardless of the ROS python version.
This obviously causes the process to fail on noetic as python-coverage is not installed (but python3-coverage is).

add_custom_target(${Coverage_NAME}_cleanup_py
COMMAND python-coverage erase
WORKING_DIRECTORY ${COVERAGE_DIR}
COMMENT "Resetting PYTHON code coverage counters to zero."
)

add_custom_target(${Coverage_NAME}_py
# Rename .coverage file generated by nosetests to avoid overwriting during combine step
COMMAND if [ -f ${PROJECT_BINARY_DIR}/.coverage ]\; then mv ${PROJECT_BINARY_DIR}/.coverage ${PROJECT_BINARY_DIR}/.coverage.nosetests\; fi
COMMAND cp ${PROJECT_BINARY_DIR}/.coverage* ${COVERAGE_DIR}/ || echo "WARNING: No python coverage!"
COMMAND python-coverage combine || echo "WARNING: No python coverage to combine!"
COMMAND python-coverage report --include "*${PROJECT_SOURCE_DIR}*" --omit ${COVERAGE_EXCLUDES} || echo "WARNING: no python report to output"
COMMAND python-coverage xml --include "*${PROJECT_SOURCE_DIR}*" --omit ${COVERAGE_EXCLUDES} || echo "WARNING: No python xml to output"
COMMAND python-coverage html --include "*${PROJECT_SOURCE_DIR}*" --omit ${COVERAGE_EXCLUDES} || echo "WARNING: No python html to output"
WORKING_DIRECTORY ${COVERAGE_DIR}
DEPENDS _run_tests_${PROJECT_NAME}
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions