test(resource): add failing tests for built-in fs-directory type bootstrap (#523) #537

Closed
opened 2026-03-04 00:41:28 +00:00 by freemo · 1 comment
Owner

Metadata

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

Background and Context

Bug #523 reports that agents resource add fs-directory 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 fs-directory 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 git-checkout resource type: see #553.

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

Acceptance Criteria

  • At least one Behave scenario verifies that fs-directory type is available after agents init.
  • At least one scenario verifies that agents resource add fs-directory local/test --path /tmp/test 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 #523 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 fs-directory type schema

2. Implementation

  • Add features/resource_type_bootstrap_fs.feature with Gherkin scenarios: (1) after init, fs-directory type exists in the registry, (2) agents resource add fs-directory local/test --path /tmp/test completes without "Resource type not found" error.
  • Add corresponding step definitions in features/steps/resource_type_bootstrap_fs_steps.py that invoke the initialization path and then attempt to add a resource of type fs-directory, 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 #523 and are expected to fail until the fix is applied.

5. Integration

  • Add robot/resource_type_bootstrap_fs.robot smoke test that runs agents resource add fs-directory 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 fs-directory type bootstrap` - **Branch**: `feature/m3-test-resource-bootstrap-fs` ## Background and Context Bug #523 reports that `agents resource add fs-directory` 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 `fs-directory` 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 `git-checkout` resource type: see #553. | Field | Value | |-------|-------| | **Type** | Testing | | **Priority** | Medium | | **MoSCoW** | Must Have | | **Points** | 3 | | **Milestone** | v3.2.0 | | **Assignee** | brent.edwards | | **Blocks** | #523 (bug fix for fs-directory) | ## Acceptance Criteria - [x] At least one Behave scenario verifies that `fs-directory` type is available after `agents init`. - [x] At least one scenario verifies that `agents resource add fs-directory local/test --path /tmp/test` 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 #523 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 `fs-directory` type schema ### 2. Implementation - [x] Add `features/resource_type_bootstrap_fs.feature` with Gherkin scenarios: (1) after init, `fs-directory` type exists in the registry, (2) `agents resource add fs-directory local/test --path /tmp/test` completes without "Resource type not found" error. - [x] Add corresponding step definitions in `features/steps/resource_type_bootstrap_fs_steps.py` that invoke the initialization path and then attempt to add a resource of type `fs-directory`, 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 #523 and are expected to fail until the fix is applied. ### 5. Integration - [x] Add `robot/resource_type_bootstrap_fs.robot` smoke test that runs `agents resource add fs-directory` 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 00:41:47 +00:00
freemo changed title from test(resource): add failing tests for built-in resource type bootstrap (#523, #524) to test(resource): add failing tests for built-in fs-directory type bootstrap (#523) 2026-03-04 01:40:16 +00:00
brent.edwards added reference feature/m3-test-resource-bootstrap-fs 2026-03-04 20:21:22 +00:00
Member

Implementation Summary

PR: #567

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

Files Added

File Purpose
features/resource_type_bootstrap_fs.feature 2 Gherkin scenarios for fs-directory bootstrap
features/steps/resource_type_bootstrap_fs_steps.py Behave step definitions using mocked container
robot/resource_type_bootstrap_fs.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 fs-directory type exists in the resource registry, and (b) agents resource add fs-directory local/test --path /tmp/test 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: Uses the same get_container mock pattern as the existing features/steps/resource_type_builtins_steps.py, providing a fresh temp SQLite per scenario via before_scenario.
  3. Scope boundary: Only tests fs-directory; the companion git-checkout type is tested separately in #553 to keep concerns isolated.

Verification

  • nox -s lint — passed
  • nox -s typecheck — passed (Pyright clean)
  • Tests are expected to fail until #523 is fixed
## Implementation Summary ### PR: #567 **Branch:** `feature/m3-test-resource-bootstrap-fs` ### Files Added | File | Purpose | |------|---------| | `features/resource_type_bootstrap_fs.feature` | 2 Gherkin scenarios for `fs-directory` bootstrap | | `features/steps/resource_type_bootstrap_fs_steps.py` | Behave step definitions using mocked container | | `robot/resource_type_bootstrap_fs.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 `fs-directory` type exists in the resource registry, and (b) `agents resource add fs-directory local/test --path /tmp/test` 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:** Uses the same `get_container` mock pattern as the existing `features/steps/resource_type_builtins_steps.py`, providing a fresh temp SQLite per scenario via `before_scenario`. 3. **Scope boundary:** Only tests `fs-directory`; the companion `git-checkout` type is tested separately in #553 to keep concerns isolated. ### Verification - `nox -s lint` — passed - `nox -s typecheck` — passed (Pyright clean) - Tests are expected to **fail** until #523 is fixed
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#537
No description provided.