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

fix: adds graph api to unload the ebpf hooks during unit test code coverage #1604

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

re-Tick
Copy link
Contributor

@re-Tick re-Tick commented Feb 22, 2024

Related Issue

  • The external calls from other unit tests are mocked by the keploy. And fails to upload code cov to platforms like Sonar Qube.

Closes: #1599

Describe the changes you've made

  • Attaches ebpf hooks from the fetch testsets graph API.
  • Starts the proxy server from the testsets graph API.
  • And Stops the proxy and hooks when the unit test ends to prevent mocking external calls of other unit tests and sonar qube.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Please let us know if any test cases are added

Tested the changes for the java application with unit test and normal test cmd.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

NA

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

re-Tick and others added 4 commits February 22, 2024 11:58
Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
since the keploy pid is extracted from the user space progrom pid and passed into the ebpf map from
the c code itself when sys-bind is called. And sys-bind is called when a port allocation occurs so,
need to start proxy server when the fetchTestsets is fired to load ebpf hooks correctly into the
kernel.

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
@re-Tick re-Tick closed this Feb 22, 2024
@re-Tick re-Tick reopened this Feb 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Copy link
Member

@gouravkrosx gouravkrosx left a comment

Choose a reason for hiding this comment

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

LGTM

@gouravkrosx gouravkrosx merged commit 9fb89f7 into main Feb 22, 2024
26 checks passed
@gouravkrosx gouravkrosx deleted the fix-sonar-qube branch February 22, 2024 11:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: mock not found for posting code cov to sonarQube
2 participants