Skip to content

test: add tests for Gitea scanner, GitLab pure functions, mergeNewAliases#568

Merged
bfabio merged 1 commit intoitalia:mainfrom
creed-bratton:add-scanner-tests
May 4, 2026
Merged

test: add tests for Gitea scanner, GitLab pure functions, mergeNewAliases#568
bfabio merged 1 commit intoitalia:mainfrom
creed-bratton:add-scanner-tests

Conversation

@creed-bratton
Copy link
Copy Markdown
Contributor

Adds the first unit tests for the scanner and crawler packages, which had 0% coverage:

  • scanner/gitea_test.go — 11 tests for GiteaScanner: happy path, private/archived/empty repos, API errors, pagination, org-to-user fallback, root instance scan
  • scanner/gitlab_test.go — tests for isGitlabGroup and generateGitlabRawURL (pure functions)
  • crawler/crawler_test.go — tests for mergeNewAliases (pure function)

Tests use httptest.Server to mock Gitea API responses without network access.

Comment thread scanner/gitea_test.go
Comment thread scanner/gitea_test.go Outdated
Comment thread scanner/gitea_test.go Outdated
Comment thread scanner/gitlab_test.go Outdated
Comment thread scanner/gitea_test.go Outdated
@bfabio bfabio force-pushed the add-scanner-tests branch from 148d181 to 75a0233 Compare May 4, 2026 15:16
@bfabio bfabio merged commit ca63886 into italia:main May 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants