Giter VIP home page Giter VIP logo

colcon-coveragepy-result's Introduction

colcon-common-extensions

A meta package aggregating colcon-core as well as a set of common extensions.

colcon-coveragepy-result's People

Contributors

christophebedard avatar cottsay avatar nuclearsandwich avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

colcon-coveragepy-result's Issues

'coverage' command/entrypoint might not exist

The Foxy (Linux) dev environment instructions recommend installing pytest-cov through apt (python3-pytest-cov), which is how a "normal" ROS 2 user would get coverage. However, this version (4.5.2 on Ubuntu 20.04) does not seem to install the coverage script/entrypoint, which colcon-coveragepy-result uses. There is currently no version constraint on coverage. Therefore running colcon coveragepy-result ... will fail. In an ubuntu:20.04 Docker container:

# coverage --help
bash: coverage: command not found
# find / -name 'coverage'
/usr/lib/python3/dist-packages/coverage

Using coverage as a Python module (python3 -m coverage) does work, though.

Upgrading coverage with pip (e.g. pip3 install -U coverage) does install the script/entrypoint and fixes the issue.

# pip3 install -U coverage
Collecting coverage
  Downloading coverage-5.1-cp38-cp38-manylinux1_x86_64.whl (229 kB)
     |████████████████████████████████| 229 kB 1.7 MB/s 
Installing collected packages: coverage
  Attempting uninstall: coverage
    Found existing installation: coverage 4.5.2
    Not uninstalling coverage at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'coverage'. No files were found to uninstall.
Successfully installed coverage-5.1
# find / -name 'coverage'
/usr/lib/python3/dist-packages/coverage
/usr/local/lib/python3.8/dist-packages/coverage
/usr/local/bin/coverage
# coverage --help
Coverage.py, version 5.1 with C extension
Measure, collect, and report on code coverage in Python programs.

usage: coverage <command> [options] [args]

Commands:
    annotate    Annotate source files with execution information.
    combine     Combine a number of data files.
    erase       Erase previously collected coverage data.
    help        Get help on using coverage.py.
    html        Create an HTML report.
    json        Create a JSON report of coverage results.
    report      Report coverage stats on modules.
    run         Run a Python program and measure code execution.
    xml         Create an XML report of coverage results.

Use "coverage help <command>" for detailed help on any command.
Full documentation is at https://coverage.readthedocs.io

Since using coverage as a Python module seems to work universally, that might be preferable.

mapping values are not allowed here

Hi,

this is my first time, I try to install a mixin and maybe I am the problem, but at least I want to report this:

$ colcon mixin add coverage-pytest https://github.com/colcon/colcon-coveragepy-result
$ colcon mixin update coverage-pytest

results into

fetching coverage-pytest: https://github.com/colcon/colcon-coveragepy-result ...
mapping values are not allowed here
in "<unicode string>", line 52, column 50:
... colcon/colcon-coveragepy-result: A colcon extension for collect ...

I am not sure, what exactly the problem is. In case this is not the correct way to install this mixin, I would be very happy about an hint (this is maybe also something, that should be done in the README).

Thanks a lot!

Release 0.0.8 on packages.ros.org ?

I'm adapting a workflow to use the latest action-ros-ci.
It now has this package as a required dependency, however it appears that action-ros-ci requires specifically 0.0.8 to work and fails with 0.0.7 (which is the latest available via the apt repositories). So if installing via apt, action-ros-ci would fail because of #15 with messages similar to:

   /usr/bin/bash -c colcon coveragepy-result 				--packages-select sros2 sros2_cmake test_security
  Starting >>> sros2
  Finished <<< sros2 [0.09s]
  [0.694s] WARNING:colcon.colcon_coveragepy_result.task.coveragepy:No .coverage files found for package 'sros2_cmake' of type 'ros.ament_cmake'
  Starting >>> sros2_cmake
  Finished <<< sros2_cmake [0.00s]
  Starting >>> test_security
  [0.696s] WARNING:colcon.colcon_coveragepy_result.task.coveragepy:No .coverage files found for package 'test_security' of type 'ros.ament_cmake'
  Finished <<< test_security [0.00s]
  [0.708s] ERROR:colcon.colcon_coveragepy_result.task.coveragepy:Command 'coverage combine /__w/sros2/sros2/ros_ws/build/sros2/coveragepy/.coverage' failed: [Errno 2] No such file or directory: 'coverage'
  [0.711s] ERROR:colcon.colcon_coveragepy_result.task.coveragepy:Command 'coverage html' failed: [Errno 2] No such file or directory: 'coverage'

Is it possible to release the new 0.0.8 version on the ROS apt repositories?
Or is it preferred to install via pip? and new releases will only be available via pip and not apt ?

Fails on pure Python packages without a .coverage file

e.g.

Starting >>> ament_lint
--- stderr: ament_lint
Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.6/site-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/home/chris/.local/lib/python3.6/site-packages/colcon_core/task/__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "/home/chris/.local/lib/python3.6/site-packages/colcon_coveragepy_result/task/coveragepy.py", line 56, in coveragepy
    copy2(original, copy)
  File "/usr/lib/python3.6/shutil.py", line 263, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/chris/ros2_ws/build/ament_lint/.coverage'
---
Failed   <<< ament_lint [ Exited with code 1 ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.