Include e2e tests for public endpoints#61
Merged
jeroenrinzema merged 5 commits intomainfrom Nov 28, 2025
Merged
Conversation
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes e2e tests using testcontainers for the currently exposed endpoints within the Nexus service.