airqo-platform / airqo-platform/AirQo-api

[Auth Service] Add test coverage for new database functions in CQRS implementation

Open
#4,518 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
26
Forks
24
Avg merge
5h 36m
Merged PRs (30d)
81

Description

## Background
In PR #4512, we introduced CQRS pattern support with dual database connections in the Auth Service. CodeRabbit identified that several of the new database functions lack test coverage.

## Required Action
Add thorough tests for the following new database functions:
- `getCommandTenantDB`
- `getQueryTenantDB`
- `getCommandModelByTenant`
- `getQueryModelByTenant`

## Importance
Since database operations are critical to the application, these functions must be comprehensively covered with tests that validate both successful paths (e.g., correct database connection and model registration) and failure conditions (e.g., when a connection is not established).

## References
- PR: https://github.com/airqo-platform/AirQo-api/pull/4512
- Comment: https://github.com/airqo-platform/AirQo-api/pull/4512#discussion_r1977705059

## Requested by
@Baalmart

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.