test: add TDD bug-capture test for #1022 — InvariantService persistence #1109
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tdd/m5-invariant-service-persistence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add Behave BDD and Robot Framework integration tests that capture bug #1022 —
InvariantServicestores invariants in an in-memory dict only, losing them across CLI process invocations.Motivation
Per the project's TDD Bug Fix Workflow (CONTRIBUTING.md), every bug must first have a test written that captures the buggy behavior before the fix is implemented. This PR fulfills the TDD counterpart issue #1032 for bug #1022.
What was done
Behave tests (
features/tdd_invariant_persistence.feature): Four scenarios tagged@tdd_expected_fail @tdd_bug @tdd_bug_1022 @mock_onlythat simulate separate CLI invocations via freshInvariantServiceinstances and assert cross-instance data visibility:Step definitions in
features/steps/tdd_invariant_persistence_steps.py.Robot integration tests (
robot/tdd_invariant_persistence.robot): Three integration test cases with a helper script (robot/helper_tdd_invariant_persistence.py) that exercises add-then-list and add-then-remove across fresh service instances.How it passes CI
All tests carry
@tdd_expected_fail, which inverts the test result via the environment hooks (Behave) and listener (Robot). The underlying assertions fail (proving the bug exists), but are reported as passed to CI. The@tdd_expected_failtag will be removed when bug #1022 is fixed, at which point the tests will run normally and must pass.Review fixes applied
InvariantScopeimport from function body inrobot/helper_tdd_invariant_persistence.pyto module-level top imports.@mock_onlytag tofeatures/tdd_invariant_persistence.feature— these tests use purely in-memory services and never touch the database.exit_code == 0assertion tostep_invoke_list_cliinfeatures/steps/tdd_invariant_persistence_steps.py, matching the pattern used instep_invoke_add_cli.context: Anyparameter types tocontext: Context(frombehave.runner), following the project-wide convention used in 335+ step files.except Exceptiontoexcept NotFoundErrorinrobot/helper_tdd_invariant_persistence.py, matching the specific error being tested.master.Quality Gates
@tdd_expected_failCloses #1032
Review: APPROVED
Exemplary TDD bug-capture PR. This is the most comprehensive TDD PR in the batch:
@tdd_expected_fail @tdd_bug @tdd_bug_1022correct in both frameworkstdd/m5-invariant-service-persistencecorrectly matches M5 (v3.4.0)features/, steps infeatures/steps/, Robot files inrobot/tdd_invariant_persistence_steps.pymatches the feature fileCloses #1032presentWell-structured Robot helper script with clear dispatch pattern. No issues found.
Day 43 Review — PR #1109
test: TDD for #1022 — InvariantService persistenceVerdict: APPROVED
TDD Verification
This is a TDD PR capturing bug #1022. Standard TDD review checklist:
@tdd_bug,@tdd_bug_1022,@tdd_expected_fail)test:prefixThe PR is mergeable with no conflicts. Once merged, the corresponding bug fix branch can be created from
master.@hamza.khyari — Please review and approve for second approval.
dbf236688697da215eb9New commits pushed, approval review dismissed automatically according to repository settings
97da215eb9a2bb1da2e6Review: APPROVED
TDD tags correct. Both Behave AND Robot Framework tests present. Step definitions fully implemented for InvariantService persistence bug. CHANGELOG entry included. Clean, complete TDD PR — no concerns.
New commits pushed, approval review dismissed automatically according to repository settings