Skip to content

Dev xhr#24

Merged
cagoya merged 6 commits into
masterfrom
dev_xhr
Dec 28, 2025
Merged

Dev xhr#24
cagoya merged 6 commits into
masterfrom
dev_xhr

Conversation

@Fronut

@Fronut Fronut commented Dec 28, 2025

Copy link
Copy Markdown
Collaborator

This pull request adds comprehensive test coverage for the backend API, configuration, database, and documentation layers. It introduces new test suites for each major handler and service, ensures route registration is validated, and tests configuration and database initialization logic. The changes also include minor dependency updates and the addition of embedded Postgres for integration testing.

The most important changes are:

API Handler and Endpoint Testing:

  • Added extended_handlers_test.go with thorough end-to-end tests for all CRUD and lifecycle operations of templates, batches, tasks, experiments, and reports, including edge cases and file download/delete scenarios.
  • Added new tests in handler_test.go to cover error handling and input validation for opportunities and price comparison endpoints.

Route Registration Verification:

  • Introduced register_test.go to assert that all API routes for templates, batches, tasks, reports, and experiments are properly registered in the Gin router.

Configuration and Database Testing:

  • Added viper_test.go to test configuration file loading and error handling for missing config directories.
  • Added database_test.go to test database initialization, connection errors, and panic conditions, using embedded Postgres for integration tests.

API Documentation and Metadata:

  • Added docs_test.go to verify that Swagger documentation is generated and customizable as expected.
  • Added swagger_config.go to enforce sensible default metadata for the Swagger spec, improving test reliability for documentation.

Dependency Updates:

  • Updated go.mod to add embedded-postgres and lib/pq for testing and integration, and bumped several dependencies to newer versions. [1] [2] [3]

@Fronut
Fronut requested review from cagoya and key88cb December 28, 2025 10:40
@Fronut Fronut self-assigned this Dec 28, 2025
@cagoya
cagoya merged commit b29ee63 into master Dec 28, 2025
6 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