Commit Graph

3 Commits

Author SHA1 Message Date
freemo 8ea00f5185 fix: restore CI quality tests to passing state (#4175)
Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-08 11:02:14 +00:00
hurui200320 1878998b7a refactor(testing): rename tdd_bug/tdd_bug_N tags to tdd_issue/tdd_issue_N
Rename the TDD tag system from tdd_bug/tdd_bug_<N> to tdd_issue/tdd_issue_<N>
across the entire codebase. The tdd_expected_fail tag is unchanged.

The TDD expected-failure workflow is not limited to bug fixes — it applies
equally to any issue type (features, tasks, refactors). The _bug suffix was
misleading and narrowed the perceived scope. The new _issue suffix accurately
reflects that the TDD tagging system applies to any Forgejo issue.

Changes span 92 files:
- features/environment.py: validate_tdd_tags(), should_invert_result(), and
  apply_tdd_inversion() updated — regex, variables, error messages
- robot/tdd_expected_fail_listener.py: _validate_tdd_tags(), _should_invert_result(),
  start_test(), end_test() updated consistently
- 33 Behave .feature files: all @tdd_bug/@tdd_bug_<N> tags renamed
- 29 Robot .robot files: all tdd_bug/tdd_bug_<N> tags renamed
- 3 Robot fixture files renamed (tdd_bug_alone, tdd_missing_tdd_bug,
  tdd_expected_fail_missing_bug_n) with content and references updated
- Tag validation tests and helpers updated (function names, command dispatch
  keys, output strings, fixture references)
- CONTRIBUTING.md: section renamed from 'TDD Bug Test Tags' to
  'TDD Issue Test Tags', all tag references and examples updated
- noxfile.py: comment references updated
- Step definition files, mock helpers, and benchmark files: docstring
  references updated

ISSUES CLOSED: #965
2026-03-27 05:58:35 +00:00
brent.edwards 231ed59ad2 test: add TDD bug-capture test for #993 — server_connect non-atomic writes
Add 3 Behave scenarios tagged @tdd_expected_fail @tdd_bug @tdd_bug_993
that prove bug #993 exists: server_connect() in server.py makes three
sequential set_value() calls with no transaction or rollback.  When a
middle call fails (simulated via _FailingConfigService subclass), the
earlier values are already persisted, leaving the config in a half-
written state.

Scenarios:
  1. Second set_value fails — asserts server.url rolled back (FAILS:
     server.url retains the new value, proving non-atomicity).
  2. Third set_value fails — asserts both url and namespace rolled back
     (FAILS: both retain new values).
  3. Empty config + second call fails — asserts server.url not persisted
     (FAILS: server.url was written despite subsequent failure).

All assertions fail as expected (the bug exists), and the
@tdd_expected_fail tag inverts these to CI passes.  When the fix in
#993 removes the tag, the tests will run normally and must pass.

Robot integration test: N/A — the non-atomic write behavior is
internal to server_connect and ConfigService.set_value; no external
system integration is involved.

Quality gates verified:
  - lint: pass
  - typecheck: pass (0 errors)
  - unit_tests: 462 features / 12233 scenarios / 46803 steps — all pass
  - integration_tests: 1537 tests — all pass
  - e2e_tests: 37 tests — all pass
  - coverage_report: 98% (threshold 97%)

ISSUES CLOSED: #1097
2026-03-23 16:49:11 +00:00