Skip to content

Add socket channel for coverage collection #2195

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

Merged
merged 3 commits into from
May 15, 2023

Conversation

tamarinvs19
Copy link
Collaborator

Description

New UDP socket channel has been added for sending numbers of the covered lines while python code are executing.

Now if function is too long, we can minimise test case by covered lines before execution timeout.

Fixes #2100

How to test

Manual tests

  1. Open a long python function, e.g. from utbot-python/samples/easy_samples/long_function_coverage.py
import time

def long_function(x: int):
    x += 4
    x /= 2
    x += 100
    x *= 3
    x -= 15
    time.sleep(2000)
    return x
  1. Try to generate tests with a normal Handing test timeout (1000ms) and Test generation timeout (60s)
  2. Expected; test have been minimised (for long_function_coverage.py only one test)

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@tamarinvs19 tamarinvs19 added ctg-enhancement New feature, improvement or change request lang-python Issue is related to python support comp-minimizer Issue is related to Minimization phase labels May 3, 2023
@tamarinvs19 tamarinvs19 requested a review from tochilinak May 3, 2023 10:56
@tamarinvs19 tamarinvs19 self-assigned this May 3, 2023
@tochilinak
Copy link
Member

I think it is time to create a common place for storing and publishing our Python scripts, because now we cannot review each other's scripts (and, more importantly, fix bugs). Kotlin part is OK.

@tamarinvs19
Copy link
Collaborator Author

I think it is time to create a common place for storing and publishing our Python scripts, because now we cannot review each other's scripts (and, more importantly, fix bugs). Kotlin part is OK.

I agree. Created Issue #2208 and started working on it.

@tamarinvs19 tamarinvs19 merged commit b34129b into main May 15, 2023
@tamarinvs19 tamarinvs19 deleted the tamarinvs19/python-coverage branch May 15, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-minimizer Issue is related to Minimization phase ctg-enhancement New feature, improvement or change request lang-python Issue is related to python support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update python coverage collection
2 participants