test(resource): add failing tests for built-in git-checkout type bootstrap (#524) #553

Closed
opened 2026-03-04 01:40:31 +00:00 by freemo · 2 comments
Owner

Metadata

  • Commit Message: test(resource): add failing tests for built-in git-checkout type bootstrap
  • Branch: feature/m3-test-resource-bootstrap-git

Background and Context

Bug #524 reports that agents resource add git-checkout fails with "Resource type not found" because bootstrap_builtin_types() in src/cleveragents/application/services/resource_registry_service.py:151 is never called during initialization. The built-in git-checkout resource type is defined in _BUILTIN_TYPES but never seeded into the database.

Before fixing the bug, we need failing tests that reproduce the problem. These tests will fail until the fix is applied, and pass once the fix is merged.

Note: A separate test issue exists for the fs-directory resource type: see #537.

Field Value
Type Testing
Priority Medium
MoSCoW Must Have
Points 3
Milestone v3.2.0
Assignee brent.edwards
Blocks #524 (bug fix for git-checkout)

Acceptance Criteria

  • At least one Behave scenario verifies that git-checkout type is available after agents init.
  • At least one scenario verifies that agents resource add git-checkout local/test --path /tmp/repo --branch main succeeds without "Resource type not found" error.
  • Tests currently fail because bootstrap_builtin_types() is never called (this is expected).
  • Tests are structured so they will pass once the fix in #524 is merged.

Definition of Done

This issue is complete when:

  • All subtasks below 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.

Subtasks

1. Design

  • Review bootstrap_builtin_types() and _BUILTIN_TYPES to understand the expected git-checkout type schema

2. Implementation

  • Add features/resource_type_bootstrap_git.feature with Gherkin scenarios: (1) after init, git-checkout type exists in the registry, (2) agents resource add git-checkout local/test --path /tmp/repo --branch main completes without "Resource type not found" error.
  • Add corresponding step definitions in features/steps/resource_type_bootstrap_git_steps.py that invoke the initialization path and then attempt to add a resource of type git-checkout, asserting the expected outcomes.

3. Testing

  • The scenarios above are the Behave tests. Verify they run (and fail as expected) via nox -s unit_tests.

4. Documentation

  • Add a brief note in the feature file header explaining these tests target bug #524 and are expected to fail until the fix is applied.

5. Integration

  • Add robot/resource_type_bootstrap_git.robot smoke test that runs agents resource add git-checkout and checks exit code.

6. Observability

  • N/A for test-only issue.

7. Security

  • N/A for test-only issue.
## Metadata - **Commit Message**: `test(resource): add failing tests for built-in git-checkout type bootstrap` - **Branch**: `feature/m3-test-resource-bootstrap-git` ## Background and Context Bug #524 reports that `agents resource add git-checkout` fails with "Resource type not found" because `bootstrap_builtin_types()` in `src/cleveragents/application/services/resource_registry_service.py:151` is never called during initialization. The built-in `git-checkout` resource type is defined in `_BUILTIN_TYPES` but never seeded into the database. Before fixing the bug, we need failing tests that reproduce the problem. These tests will fail until the fix is applied, and pass once the fix is merged. **Note:** A separate test issue exists for the `fs-directory` resource type: see #537. | Field | Value | |-------|-------| | **Type** | Testing | | **Priority** | Medium | | **MoSCoW** | Must Have | | **Points** | 3 | | **Milestone** | v3.2.0 | | **Assignee** | brent.edwards | | **Blocks** | #524 (bug fix for git-checkout) | ## Acceptance Criteria - [x] At least one Behave scenario verifies that `git-checkout` type is available after `agents init`. - [x] At least one scenario verifies that `agents resource add git-checkout local/test --path /tmp/repo --branch main` succeeds without "Resource type not found" error. - [x] Tests currently **fail** because `bootstrap_builtin_types()` is never called (this is expected). - [x] Tests are structured so they will **pass** once the fix in #524 is merged. ## Definition of Done This issue is complete when: - All subtasks below 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. ## Subtasks ### 1. Design - [x] Review `bootstrap_builtin_types()` and `_BUILTIN_TYPES` to understand the expected `git-checkout` type schema ### 2. Implementation - [x] Add `features/resource_type_bootstrap_git.feature` with Gherkin scenarios: (1) after init, `git-checkout` type exists in the registry, (2) `agents resource add git-checkout local/test --path /tmp/repo --branch main` completes without "Resource type not found" error. - [x] Add corresponding step definitions in `features/steps/resource_type_bootstrap_git_steps.py` that invoke the initialization path and then attempt to add a resource of type `git-checkout`, asserting the expected outcomes. ### 3. Testing - [x] The scenarios above **are** the Behave tests. Verify they run (and fail as expected) via `nox -s unit_tests`. ### 4. Documentation - [x] Add a brief note in the feature file header explaining these tests target bug #524 and are expected to fail until the fix is applied. ### 5. Integration - [x] Add `robot/resource_type_bootstrap_git.robot` smoke test that runs `agents resource add git-checkout` and checks exit code. ### 6. Observability - [ ] N/A for test-only issue. ### 7. Security - [ ] N/A for test-only issue.
freemo added this to the v3.2.0 milestone 2026-03-04 01:40:39 +00:00
brent.edwards added reference feature/m3-test-resource-bootstrap-git 2026-03-04 20:21:23 +00:00
Member

Implementation Summary

PR: #568

Branch: feature/m3-test-resource-bootstrap-git

Files Added

File Purpose
features/resource_type_bootstrap_git.feature 2 Gherkin scenarios for git-checkout bootstrap
features/steps/resource_type_bootstrap_git_steps.py Behave step definitions using mocked container
robot/resource_type_bootstrap_git.robot Robot Framework integration smoke test
CHANGELOG.md Entry added under Unreleased > Testing

Design Decisions

  1. Test approach: Scenarios verify (a) after agents init, the git-checkout type exists in the resource registry, and (b) agents resource add git-checkout local/test --path /tmp/repo --branch main completes without "Resource type not found". Both fail because bootstrap_builtin_types() is never called during init — this is intentional per the TDD workflow.
  2. Mock strategy: Same get_container mock pattern as features/steps/resource_type_builtins_steps.py, fresh temp SQLite per scenario.
  3. Scope boundary: Only tests git-checkout; the companion fs-directory type is tested separately in #537.

Verification

  • nox -s lint — passed
  • nox -s typecheck — passed (Pyright clean)
  • Tests are expected to fail until #524 is fixed
## Implementation Summary ### PR: #568 **Branch:** `feature/m3-test-resource-bootstrap-git` ### Files Added | File | Purpose | |------|---------| | `features/resource_type_bootstrap_git.feature` | 2 Gherkin scenarios for `git-checkout` bootstrap | | `features/steps/resource_type_bootstrap_git_steps.py` | Behave step definitions using mocked container | | `robot/resource_type_bootstrap_git.robot` | Robot Framework integration smoke test | | `CHANGELOG.md` | Entry added under Unreleased > Testing | ### Design Decisions 1. **Test approach:** Scenarios verify (a) after `agents init`, the `git-checkout` type exists in the resource registry, and (b) `agents resource add git-checkout local/test --path /tmp/repo --branch main` completes without "Resource type not found". Both fail because `bootstrap_builtin_types()` is never called during init — this is intentional per the TDD workflow. 2. **Mock strategy:** Same `get_container` mock pattern as `features/steps/resource_type_builtins_steps.py`, fresh temp SQLite per scenario. 3. **Scope boundary:** Only tests `git-checkout`; the companion `fs-directory` type is tested separately in #537. ### Verification - `nox -s lint` — passed - `nox -s typecheck` — passed (Pyright clean) - Tests are expected to **fail** until #524 is fixed
Author
Owner

PM Closure Note — Day 29

All work for this issue is complete:

  • TDD tests merged: PR #568 merged on Day 27 (Mar 7) by @brent.edwards
  • Bug fixed: Bug #524 (git-checkout bootstrap) was fixed by @freemo in PR #626 (merged Day 28)
  • All acceptance criteria checked in the issue body
  • All subtasks complete (Design, Implementation, Testing, Documentation, Integration)

The TDD tests in features/resource_type_bootstrap_git.feature now pass (no longer expected-to-fail) since bootstrap_builtin_types() is properly called after PR #626.

Closing this issue as State/Completed.

## PM Closure Note — Day 29 All work for this issue is complete: - **TDD tests merged**: PR #568 merged on Day 27 (Mar 7) by @brent.edwards - **Bug fixed**: Bug #524 (git-checkout bootstrap) was fixed by @freemo in PR #626 (merged Day 28) - **All acceptance criteria checked** in the issue body - **All subtasks complete** (Design, Implementation, Testing, Documentation, Integration) The TDD tests in `features/resource_type_bootstrap_git.feature` now pass (no longer expected-to-fail) since `bootstrap_builtin_types()` is properly called after PR #626. Closing this issue as **State/Completed**.
freemo 2026-03-09 02:49:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#553
No description provided.