Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backlog #81

Closed
wants to merge 40 commits into from
Closed

Backlog #81

wants to merge 40 commits into from

Conversation

Dan-Ailenei
Copy link
Collaborator

#78

return self


_Backlog.filter = _backlog_filter
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use tricks like this as it would prevent a certain class of optimizations in the future Cython implementation. Everything needs to be implemented in the predicate class (a filter method that just copies itself + the filter args - it only needs to import Q locally).

@ionelmc
Copy link
Owner

ionelmc commented Mar 27, 2020

I've added an integration tests that expects two backlog set of outputs (it fails because of the use fo the self.called flag - it should be removed).

However this reveals a problem with how the indentation is or could be managed. While on the first output the indentation will be fine ... on the second output from the backlog the indentation will be all wrong since there aren't any matching return events from the first backlog output.

It would looks like this:

gration.py:648   call      => test_backlog_before_call(LineMatcher=<class '_pytest.pytester.LineMatcher'>) [backlog]
sample7.py:7     call         => one(a=None, b=None) [backlog]
sample7.py:13    call            => two(c={'3': [4, 5], 'side': 'effect'}) [backlog]
sample7.py:18    call               => three() [backlog]
sample7.py:17    line                  for i in range(1):  # three [backlog]
sample7.py:18    line                  four() [backlog]
sample7.py:21    call                  => four() [backlog]
sample7.py:22    line                     for i in range(1):  # four [backlog]
sample7.py:23    line                     five() [backlog]
sample7.py:26    call                     => five()
sample7.py:27    line                        in_five = 1
sample7.py:28    line                        for i in range(1):  # five
sample7.py:29    line                        return i  # five
sample7.py:29    return                   <= five: 0
gration.py:648   call                     => test_backlog_before_call(LineMatcher=<class '_pytest.pytester.LineMatcher'>) [backlog]
sample7.py:7     call                        => one(a=None, b=None) [backlog]
sample7.py:13    call                           => two(c={'3': [4, 5], 'side': 'effect'}) [backlog]
sample7.py:18    call                              => three() [backlog]
sample7.py:17    line                                 for i in range(1):  # three [backlog]
sample7.py:18    line                                 four() [backlog]
sample7.py:21    call                                 => four() [backlog]
sample7.py:22    line                                    for i in range(1):  # four [backlog]
sample7.py:23    line                                    five() [backlog]
sample7.py:26    call                                    => five()
sample7.py:27    line                                       in_five = 1
sample7.py:28    line                                       for i in range(1):  # five
sample7.py:29    line                                       return i  # five
sample7.py:29    return                                  <= five: 0

So given this problem that is not easy to solve perhaps it's not even worth trying to address consistent identation.

Without any indentation sharing or action instance sharing:

gration.py:648   call      => test_backlog_before_call(LineMatcher=<class '_pytest.pytester.LineMatcher'>) [backlog]
sample7.py:7     call         => one(a=None, b=None) [backlog]
sample7.py:13    call            => two(c={'3': [4, 5], 'side': 'effect'}) [backlog]
sample7.py:18    call               => three() [backlog]
sample7.py:17    line                  for i in range(1):  # three [backlog]
sample7.py:18    line                  four() [backlog]
sample7.py:21    call                  => four() [backlog]
sample7.py:22    line                     for i in range(1):  # four [backlog]
sample7.py:23    line                     five() [backlog]
sample7.py:26    call      => five()
sample7.py:27    line         in_five = 1
sample7.py:28    line         for i in range(1):  # five
sample7.py:29    line         return i  # five
sample7.py:29    return    <= five: 0
gration.py:648   call      => test_backlog_before_call(LineMatcher=<class '_pytest.pytester.LineMatcher'>) [backlog]
sample7.py:7     call         => one(a=None, b=None) [backlog]
sample7.py:13    call            => two(c={'3': [4, 5], 'side': 'effect'}) [backlog]
sample7.py:18    call               => three() [backlog]
sample7.py:17    line                  for i in range(1):  # three [backlog]
sample7.py:18    line                  four() [backlog]
sample7.py:21    call                  => four() [backlog]
sample7.py:22    line                     for i in range(1):  # four [backlog]
sample7.py:23    line                     five() [backlog]
sample7.py:26    call      => five()
sample7.py:27    line         in_five = 1
sample7.py:28    line         for i in range(1):  # five
sample7.py:29    line         return i  # five
sample7.py:29    return    <= five: 0

@codecov-io
Copy link

codecov-io commented Mar 28, 2020

Codecov Report

Merging #81 into master will decrease coverage by 3.7%.
The diff coverage is 73.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
- Coverage   82.09%   78.39%   -3.71%     
==========================================
  Files          13       13              
  Lines        1960     2064     +104     
  Branches      255      274      +19     
==========================================
+ Hits         1609     1618       +9     
- Misses        319      402      +83     
- Partials       32       44      +12
Impacted Files Coverage Δ
src/hunter/util.py 83.63% <25%> (-11.65%) ⬇️
src/hunter/predicates.py 92.77% <69.76%> (-7.23%) ⬇️
src/hunter/event.py 67.91% <72.72%> (+9.58%) ⬆️
src/hunter/actions.py 89.58% <87.5%> (+0.66%) ⬆️
src/hunter/__init__.py 89.1% <94.44%> (+1.4%) ⬆️
src/hunter/backports/inspect.py 0% <0%> (-85.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c0a356...3bf7b3f. Read the comment docs.

@ionelmc
Copy link
Owner

ionelmc commented Mar 28, 2020

Need to figure out the uncovered corner-cases and the we can proceed with the Cython implementation.

@ionelmc ionelmc closed this May 25, 2020
@ionelmc
Copy link
Owner

ionelmc commented May 25, 2020

Rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants