Skip to content

Include e2e tests for public endpoints#61

Merged
jeroenrinzema merged 5 commits intomainfrom
feat/nexus-testcontainers
Nov 28, 2025
Merged

Include e2e tests for public endpoints#61
jeroenrinzema merged 5 commits intomainfrom
feat/nexus-testcontainers

Conversation

@jeroenrinzema
Copy link
Copy Markdown
Contributor

This PR includes e2e tests using testcontainers for the currently exposed endpoints within the Nexus service.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds end-to-end tests for the Nexus service's public endpoints using testcontainers. The implementation includes a new PostgreSQL container helper, test files for campaign and template controllers, and necessary database store modifications to support test data creation. The changes also include enhanced error handling for "not found" scenarios in the API controllers.

  • Added e2e tests using testcontainers for campaigns and templates endpoints
  • Introduced PostgreSQL testcontainer helper for isolated database testing
  • Enhanced error handling to properly return 404 responses for missing resources

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/nexus/internal/store/projects.go Added CreateProject method and updated field ordering in Project struct; modified GetProject query to explicitly list columns
services/nexus/internal/http/controllers/v1/templates_test.go Added e2e test for GetTemplate endpoint with found/not found scenarios
services/nexus/internal/http/controllers/v1/templates.go Added explicit handling for sql.ErrNoRows to return 404 responses
services/nexus/internal/http/controllers/v1/http_test.go Added shared DefaultProject test fixture
services/nexus/internal/http/controllers/v1/campaigns_test.go Added comprehensive e2e tests for all campaign endpoints
services/nexus/internal/http/controllers/v1/campaigns.go Added explicit handling for sql.ErrNoRows to return 404 responses
pkg/http/problem/problem.go Enhanced comment clarity for the Describe function's error wrapping behavior
pkg/container/postgres.go Added RunPostgreSQL helper to create isolated test databases using testcontainers
go.mod Added testcontainers and related dependencies; updated various dependency versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/nexus/internal/store/projects.go Outdated
Comment thread services/nexus/internal/http/controllers/v1/campaigns_test.go Outdated
Base automatically changed from feat/nexus to main November 28, 2025 09:21
@jeroenrinzema jeroenrinzema merged commit 6d0d0b8 into main Nov 28, 2025
2 checks passed
@jeroenrinzema jeroenrinzema deleted the feat/nexus-testcontainers branch November 28, 2025 09:23
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