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

Migrate tests to RPyC #1040

Merged
merged 37 commits into from
Jan 9, 2024
Merged

Migrate tests to RPyC #1040

merged 37 commits into from
Jan 9, 2024

Conversation

hugsy
Copy link
Owner

@hugsy hugsy commented Jan 8, 2024

Description

This is a major PR, but long overdue.

GEF can now use RPyC to completely control the tests which not only make them way faster, also allow to control directly from the pytest tests themselves gdb and gef (see examples). Tests are therefore smaller, less messy, and more accurate than when using the legacy function gdb_run_cmd.

The documentation in docs/testing.md has been updated accordingly.

This allowed to find a few missing things in gef.py itself, which were added but nothing major.

Note that currently the PR is not perfect as I did not re-write the tests: I've migrated most of the code to the new API to ensure coverage stays identical. This was done because the PR is already big enough as it is. More accurate tests can be added in following PRs.

Checklist

  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • If my change adds new code, adequate tests have been added.
  • I have read and agree to the CONTRIBUTING document.

Copy link

github-actions bot commented Jan 8, 2024

🤖 Coverage update for 3c124dc

  • Diff Commit: deeab2f..3c124dc
  • Current vs New Coverage Score: 71.7404% / 44.3423%
  • Difference: -27.398099999999992 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • does not include forbidden words

Copy link

github-actions bot commented Jan 8, 2024

🤖 Coverage update for 21326f7

  • Diff Commit: deeab2f..21326f7
  • Current vs New Coverage Score: 71.7404% / 71.6194%
  • Difference: -0.12099999999999511 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • does not include forbidden words

Copy link

github-actions bot commented Jan 8, 2024

🤖 Coverage update for 38c1c6d

  • Diff Commit: deeab2f..38c1c6d
  • Current vs New Coverage Score: 71.7404% / 71.6194%
  • Difference: -0.12099999999999511 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • does not include forbidden words

tests/base.py Outdated Show resolved Hide resolved
tests/commands/aliases.py Outdated Show resolved Hide resolved
docs/testing.md Outdated Show resolved Hide resolved
docs/testing.md Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Outdated Show resolved Hide resolved
gef.py Show resolved Hide resolved
Copy link

github-actions bot commented Jan 8, 2024

🤖 Coverage update for 8eda99b

  • Diff Commit: deeab2f..8eda99b
  • Current vs New Coverage Score: 71.7404% / 71.5980%
  • Difference: -0.14239999999999498 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • includes the forbidden words:'breakpoint'

Copy link

github-actions bot commented Jan 9, 2024

🤖 Coverage update for 96f3cd2

  • Diff Commit: deeab2f..96f3cd2
  • Current vs New Coverage Score: 71.7404% / 71.6400%
  • Difference: -0.10039999999999338 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • includes the forbidden words:'breakpoint'

Copy link

github-actions bot commented Jan 9, 2024

🤖 Coverage update for 7aa266d

  • Diff Commit: deeab2f..7aa266d
  • Current vs New Coverage Score: 71.7404% / 71.6400%
  • Difference: -0.10039999999999338 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • includes the forbidden words:'breakpoint'

Copy link
Collaborator

@Grazfather Grazfather left a comment

Choose a reason for hiding this comment

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

Didn't check every test, just a few plus the new utils, base, scripts, and gef.py. Looks good.

tests/api/gef_session.py Show resolved Hide resolved
tests/config/__init__.py Show resolved Hide resolved
tests/base.py Show resolved Hide resolved
tests/base.py Show resolved Hide resolved
tests/commands/xinfo.py Show resolved Hide resolved
tests/commands/patch.py Show resolved Hide resolved
Copy link

github-actions bot commented Jan 9, 2024

🤖 Coverage update for 09a99c4

  • Diff Commit: deeab2f..09a99c4
  • Current vs New Coverage Score: 71.7404% / 71.6400%
  • Difference: -0.10039999999999338 🔴

To this point, this PR:

  • includes changes to tests
  • includes changes to documentation
  • includes the forbidden words:'breakpoint'

@hugsy hugsy merged commit bcaabff into main Jan 9, 2024
5 checks passed
@hugsy hugsy deleted the migrate_tests_to_rpyc branch January 9, 2024 21:02
@hugsy hugsy mentioned this pull request Jan 9, 2024
12 tasks
hugsy added a commit to hugsy/gef-extras that referenced this pull request Jan 10, 2024
## Description/Motivation/Screenshots

This PR is the GEF-Extras counter-part of hugsy/gef#1040 

Also since `kallsyms` was removed from GEF (in preparation for the
kernel module), it was added here with its tests

## How Has This Been Tested ?

"Tested" indicates that the PR works *and* the unit test (i.e. `make
test`) run passes without issue.

*  [x] x86-32
*  [x] x86-64
*  [ ] ARM
*  [x] AARCH64
*  [ ] MIPS
*  [ ] POWERPC
*  [ ] SPARC
*  [ ] RISC-V

## Checklist

<!-- N.B.: Your patch won't be reviewed unless fulfilling the following
base requirements: -->
<!--- Put an `x` in all the boxes that are complete, or that don't apply
-->
*  [x] My code follows the code style of this project.
*  [x] My change includes a change to the documentation, if required.
*  [x] If my change adds new code,
[adequate tests](https://hugsy.github.io/gef/testing) have been added.
*  [x] I have read and agree to the

[CONTRIBUTING](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md)
document.

---------

Co-authored-by: Grazfather <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants