emoss08 / Trenova

An Open Source AI-driven asset based transportation management system
http://trenova.app
Other
24 stars 5 forks source link

🍪(chore): improve test coverage #279

Closed emoss08 closed 1 month ago

emoss08 commented 1 month ago

Summary by Sourcery

Improve test coverage by introducing Docker-based test database setup, adding new test cases for various services, and enhancing existing components and models with better styling and functionality. Update CI workflow to use Redis service and refactor codebase for improved maintainability.

New Features:

Bug Fixes:

Enhancements:

Build:

CI:

Tests:

Chores:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request aims to improve test coverage by adding new tests, refactoring existing code, and making various enhancements across multiple files. The changes include the addition of new test cases, refactoring of database setup for tests, and improvements to the frontend components.

File-Level Changes

Files Changes
pkg/testutils/test_db.go
pkg/testutils/test_fiber_app.go
pkg/testutils/factory/organization_factory.go
Refactored test utilities to use Docker for creating and managing test databases, and updated factory functions for creating test data.
web/frontend/src/pages/admin/AuditLogs.tsx
web/frontend/src/components/common/fields/select-input.tsx
web/frontend/src/components/layout/aside-menu.tsx
web/frontend/src/components/layout/user-aside-menu.tsx
web/frontend/src/components/layout/logo.tsx
web/frontend/src/components/layout/user-avatar-menu.tsx
web/frontend/src/components/audit-log/audit-log-table.tsx
web/frontend/src/components/common/table/data-table-export-modal.tsx
web/frontend/src/components/common/table/data-table.tsx
web/frontend/src/components/layout/breadcrumb.tsx
web/frontend/src/components/ui/dialog.tsx
web/frontend/src/components/ui/sheet.tsx
Updated various frontend components for improved styling, layout, and functionality.
pkg/models/division_code.go
pkg/models/business_unit.go
pkg/models/commodity.go
pkg/models/hazardous_material.go
pkg/models/general_ledger_account.go
pkg/models/accessorial_charge.go
pkg/models/charge_type.go
pkg/models/customer.go
pkg/models/document_classification.go
pkg/models/qualifier_code.go
Updated model annotations to use bun ORM and refactored model fields and relationships.
internal/api/services/report.service.go
internal/api/handlers/report.handler.go
internal/api/services/chargetype.service.go
internal/api/services/accessorialcharge.service.go
internal/api/common/audittable_service.go
internal/api/services/customer.service.go
internal/api/services/generalledgeraccount.service.go
internal/api/services/location.service_test.go
internal/api/services/customer.service_test.go
internal/api/services/accessorialcharge.service_test.go
internal/api/services/commenttype.service_test.go
internal/api/services/commodity.service_test.go
internal/api/services/delaycode.service_test.go
Added new test cases for various services and updated service implementations for better error handling and logging.
go.mod
platform/job-processor-service/go.mod
Updated dependencies to the latest versions and added new dependencies for testing and Docker integration.
.github/workflows/test.yml
Makefile
Updated GitHub Actions workflow and Makefile to improve test execution and reporting.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.