TEST-INFRA: [test-data-quality] Add negative tests to database_repositories.feature #2470

Open
opened 2026-04-03 18:34:20 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/database-repositories-negative-tests
  • Commit Message: test(database_repositories): add negative test scenarios for error conditions and edge cases
  • Milestone: v3.8.0
  • Parent Epic: #1678

Description

The scenarios in features/database_repositories.feature only test the "happy path" for the database repository operations. They do not cover any error conditions or edge cases.

Recommendation:

Add new scenarios to test for the following conditions:

  • Trying to create a project with a name that already exists.
  • Trying to retrieve a project, plan, or context that does not exist.
  • Trying to update a project or plan with invalid data (e.g., a name that is too long, an invalid status).
  • Concurrency issues (e.g., two processes trying to update the same record at the same time).

Adding these scenarios will make the tests more robust and increase confidence in the reliability of the database repositories.

Subtasks

  • Add scenario: attempt to create a project with a duplicate name — expect appropriate error/exception
  • Add scenario: attempt to retrieve a non-existent project by ID — expect None or NotFoundError
  • Add scenario: attempt to retrieve a non-existent plan by ID — expect None or NotFoundError
  • Add scenario: attempt to retrieve a non-existent context by ID — expect None or NotFoundError
  • Add scenario: attempt to update a project with an invalid name (too long) — expect validation error
  • Add scenario: attempt to update a plan with an invalid status value — expect validation error
  • Add scenario: simulate concurrent updates to the same record — expect correct conflict handling
  • Implement step definitions for all new scenarios in the corresponding steps file
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `test/database-repositories-negative-tests` - **Commit Message**: `test(database_repositories): add negative test scenarios for error conditions and edge cases` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Description The scenarios in `features/database_repositories.feature` only test the "happy path" for the database repository operations. They do not cover any error conditions or edge cases. **Recommendation:** Add new scenarios to test for the following conditions: * Trying to create a project with a name that already exists. * Trying to retrieve a project, plan, or context that does not exist. * Trying to update a project or plan with invalid data (e.g., a name that is too long, an invalid status). * Concurrency issues (e.g., two processes trying to update the same record at the same time). Adding these scenarios will make the tests more robust and increase confidence in the reliability of the database repositories. ## Subtasks - [ ] Add scenario: attempt to create a project with a duplicate name — expect appropriate error/exception - [ ] Add scenario: attempt to retrieve a non-existent project by ID — expect `None` or `NotFoundError` - [ ] Add scenario: attempt to retrieve a non-existent plan by ID — expect `None` or `NotFoundError` - [ ] Add scenario: attempt to retrieve a non-existent context by ID — expect `None` or `NotFoundError` - [ ] Add scenario: attempt to update a project with an invalid name (too long) — expect validation error - [ ] Add scenario: attempt to update a plan with an invalid status value — expect validation error - [ ] Add scenario: simulate concurrent updates to the same record — expect correct conflict handling - [ ] Implement step definitions for all new scenarios in the corresponding steps file - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 18:34:37 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have — Spec compliance or quality improvement that should be included in the milestone.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have — Spec compliance or quality improvement that should be included in the milestone. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2470
No description provided.