Skip to content

test: comprehensive admin API test coverage#27

Merged
christianromeni merged 1 commit intomainfrom
feat/test-coverage
Mar 27, 2026
Merged

test: comprehensive admin API test coverage#27
christianromeni merged 1 commit intomainfrom
feat/test-coverage

Conversation

@christianromeni
Copy link
Copy Markdown
Contributor

Summary

Adds ~3700 lines of integration tests for previously untested admin API handlers.

  • models_test.go — 17 test functions: CRUD, strategy validation, deployment inclusion, test-connection with mock servers, RBAC, API key redaction
  • invites_test.go — create/list/revoke invites, email validation, cross-org RBAC
  • model_aliases_test.go — org + team alias CRUD, duplicate detection, RBAC
  • model_access_test.go — org + team allowlists, most-restrictive-wins enforcement, RBAC

All tests use real SQLite in-memory databases, no mocks.

Test plan

  • go test ./internal/api/admin/... -race -count=1
  • Coverage increase visible on Codecov

- models_test.go: 17 test functions covering CRUD, strategy validation,
  deployment inclusion, test-connection with mock servers, RBAC
- invites_test.go: create/list/revoke invites, email validation, RBAC
- model_aliases_test.go: org + team alias CRUD, duplicate detection, RBAC
- model_access_test.go: org + team allowlists, most-restrictive-wins, RBAC

Covers ~1200 previously uncovered lines across the admin API.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@christianromeni christianromeni merged commit fb4ffe6 into main Mar 27, 2026
6 checks passed
@christianromeni christianromeni deleted the feat/test-coverage branch March 27, 2026 15:36
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.

1 participant