Skip to content

test: add unit tests for fossa-filter.py#338

Merged
SebTardif merged 1 commit into
mainfrom
test/fossa-filter-tests
Jun 21, 2026
Merged

test: add unit tests for fossa-filter.py#338
SebTardif merged 1 commit into
mainfrom
test/fossa-filter-tests

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Closes #337

Add scripts/test_fossa_filter.py with 26 tests covering all code paths in the FOSSA false positive filter:

  • extract_package() parsing (5 tests)
  • is_false_positive() pattern matching (8 tests)
  • filter_via_text() fallback path (5 tests)
  • main() integration (8 tests)

Add make python-test target, wired into verify-quick. Tests run locally on every make verify-quick and in CI when Makefile or scripts/ changes.

Closes #337

Add scripts/test_fossa_filter.py with 26 tests covering:
- extract_package() parsing (ecosystem prefix, version suffix, edge cases)
- is_false_positive() for all known patterns (k8s.io outdated, x/text
  CC-BY-SA, x/crypto openssl-ssleay) and genuine issues
- filter_via_text() fallback (filtered, genuine, mixed, empty, missing)
- main() integration (JSON, text fallback, malformed, dict format)

Add make python-test target, wired into verify-quick.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@github-actions github-actions Bot added size/m 50-249 lines changed area/ci CI/CD workflows labels Jun 20, 2026
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage remains at 92%, unchanged from the branch.


Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@SebTardif SebTardif enabled auto-merge (squash) June 21, 2026 00:08
@SebTardif SebTardif merged commit 9ba9559 into main Jun 21, 2026
38 checks passed
@SebTardif SebTardif deleted the test/fossa-filter-tests branch June 21, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD workflows size/m 50-249 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add unit tests for scripts/fossa-filter.py

1 participant