Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Handle coverage having floats + BrPart in report output #107

Open
cooperlees opened this issue Mar 7, 2021 · 0 comments
Open

Handle coverage having floats + BrPart in report output #107

cooperlees opened this issue Mar 7, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@cooperlees
Copy link
Contributor

How is ptr not doing what you expect?

Seems we need to handle "exit" in the coverage output

What is your suggestion to make this better?

Handle it and not crash!

Code/Bug example?

/Users/cooper/repos/ansible_shed/setup.py:
Name                         Stmts   Miss Branch BrPart     Cover   Missing
---------------------------------------------------------------------------
ansible_shed/main.py            33     13      2      1    60.00%   22-27, 31, 35, 39-43, 77-78, 82
ansible_shed/tests/base.py      10      0      2      1    91.67%   19->exit
---------------------------------------------------------------------------
TOTAL                           43     13      4      2    68.09%

Traceback (most recent call last):
  File "/tmp/tas/bin/ptr", line 8, in <module>
    sys.exit(main())
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 1097, in main
    loop.run_until_complete(
  File "/opt/homebrew/Cellar/python38/3.8.3_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 1000, in async_main
    return await run_tests(
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 949, in run_tests
    await asyncio.gather(*consumers)
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 693, in _test_runner
    test_fail_result, steps_ran = await _test_steps_runner(
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 653, in _test_steps_runner
    a_test_result = _analyze_coverage(
  File "/private/tmp/tas/lib/python3.8/site-packages/ptr.py", line 180, in _analyze_coverage
    int(sl[1]), int(sl[2]), int(sl[3][:-1]), sl[4]
ValueError: invalid literal for int() with base 10: ''

How can a developer reproduce this?

Unsure as of now. Need to read coverage docs to understand what "exit" 100% means.

@cooperlees cooperlees added bug Something isn't working help wanted Extra attention is needed labels Mar 7, 2021
@cooperlees cooperlees changed the title New coverage can have exit in report Handle coverage now having exit in report output Mar 7, 2021
@cooperlees cooperlees changed the title Handle coverage now having exit in report output Handle coverage having floats + BrPart in report output Mar 16, 2021
cooperlees added a commit that referenced this issue Mar 16, 2021
- We need to support floats as coverage can return floats
- Make function for cleaner % removal

Testing: Update tests to ensure it works

Addresses part of #107
spurav pushed a commit that referenced this issue Mar 16, 2021
- We need to support floats as coverage can return floats
- Make function for cleaner % removal

Testing: Update tests to ensure it works

Addresses part of #107
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant