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

Add unit tests for vulnerability report and fix first_seen #2462

Merged
merged 6 commits into from
Feb 12, 2024

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented Feb 7, 2024

Changes

This adds unit tests for the vulnerability report. I spend some time figuring out how to best mock the octopoes calls. I created a a mock octopoes connector class on which you can set a dictionary with queries and the results that should be returned. Suggestions on how to this better / make it easier to write tests are welcome.

It also fixes that first_seen of the previous finding was used if the finding didn't have a history (I spotted this while reading the code to write the tests).


Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@dekkers dekkers requested a review from a team as a code owner February 7, 2024 14:07
@dekkers dekkers self-assigned this Feb 7, 2024
@dekkers dekkers changed the title Add unit tests for vulnerability and fix first_seen bug Add unit tests for vulnerability and fix first_seen Feb 7, 2024
@dekkers dekkers changed the title Add unit tests for vulnerability and fix first_seen Add unit tests for vulnerability report and fix first_seen Feb 12, 2024
@underdarknl
Copy link
Contributor

Lets implement last seen in a new ticket.

@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.

What works:

All seems to work well, ready for merge.

What doesn't work:

n/a

Bug or feature?:

n/a

@underdarknl underdarknl merged commit 18e236b into main Feb 12, 2024
11 checks passed
@underdarknl underdarknl deleted the vulnerability-report-unit-test branch February 12, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants