Skip to content

add unit tests to test importer deduplication#13372

Merged
rossops merged 8 commits intoDefectDojo:bugfixfrom
valentijnscholten:dedupe-importers-unittests
Oct 14, 2025
Merged

add unit tests to test importer deduplication#13372
rossops merged 8 commits intoDefectDojo:bugfixfrom
valentijnscholten:dedupe-importers-unittests

Conversation

@valentijnscholten
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten commented Oct 7, 2025

There's a (very) comprehensive test suite to test the deduplication logic for all dedupe algorithm types in https://github.com/DefectDojo/django-DefectDojo/blob/master/unittests/test_deduplication_logic.py.
This tests deduplication logic by creating findings, triggering dedupe and assess the results.

What we also need is unit tests that perform a full import process and assess the dedeuplication logic of the importer. Currently this is identical to what happens when creating findings on their own. But this might change in a future PR where we optimize deduplication for batches of findings.

This PR adds these unit tests so we capture the current behaviour and can safely go for that batch dedupe PR.

We also capture the query counts and async counts. Existing counts have been raised slightly because we enabled dedupe.

@valentijnscholten valentijnscholten added this to the 2.51.1 milestone Oct 7, 2025
@valentijnscholten valentijnscholten changed the title add unit tests to test import deduplication add unit tests to test importer deduplication Oct 7, 2025
@valentijnscholten valentijnscholten force-pushed the dedupe-importers-unittests branch from 523931c to 64e120b Compare October 11, 2025 17:08
@mtesauro
Copy link
Copy Markdown
Contributor

Love this. Can't wait to see it come out of "Draft"

@valentijnscholten valentijnscholten marked this pull request as ready for review October 11, 2025 19:05
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

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

Approved

@rossops rossops merged commit d4caea5 into DefectDojo:bugfix Oct 14, 2025
148 checks passed
Maffooch pushed a commit to valentijnscholten/django-DefectDojo that referenced this pull request Feb 16, 2026
…orters-unittests

add unit tests to test importer deduplication
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.

5 participants