test_log_adapter checks outdated backend interface (open/write/close instead of new) #142

Closed
opened 2026-10-14 19:08:14 +02:00 by michael · 1 comment
Owner

Problem

test/test_log_adapter.lua still checks the old backend interface
(open/write/close). Since 47386c5 (2026-06-04) adapters/log expects
log backends to provide a constructor only:

function M.required_ops()
  return { "new" }
end

The test was written one day earlier (7d08db7, 2026-06-03) and was
never updated. It has failed since June (5 of 25 checks) and was
hidden among the submodule test failures.

The three "check missing open/write/close" cases pass by accident:
they fail because new is missing, not because the named op is
missing. The test does not check what it claims.

Note: open/write/close in M._contracts are the adapter's own
functions and are unchanged. Only the backend interface changed.

Scope

  • required_ops check: expect { "new" } instead of open/write/close
  • mock backends (valid and missing cases): module with new()
  • missing case: one check for a backend without new()
  • no change to adapters/log/init.lua

Acceptance criteria

  • test_log_adapter.lua passes on Lua 5.1 and 5.4
  • every check fails for the reason its name states
  • fragjan code . shows no new findings

DAW/fragjan#124

## Problem test/test_log_adapter.lua still checks the old backend interface (open/write/close). Since 47386c5 (2026-06-04) adapters/log expects log backends to provide a constructor only: function M.required_ops() return { "new" } end The test was written one day earlier (7d08db7, 2026-06-03) and was never updated. It has failed since June (5 of 25 checks) and was hidden among the submodule test failures. The three "check missing open/write/close" cases pass by accident: they fail because `new` is missing, not because the named op is missing. The test does not check what it claims. Note: open/write/close in M._contracts are the adapter's own functions and are unchanged. Only the backend interface changed. ## Scope - required_ops check: expect { "new" } instead of open/write/close - mock backends (valid and missing cases): module with new() - missing case: one check for a backend without new() - no change to adapters/log/init.lua ## Acceptance criteria - [ ] test_log_adapter.lua passes on Lua 5.1 and 5.4 - [ ] every check fails for the reason its name states - [ ] fragjan code . shows no new findings ## Related DAW/fragjan#124
Author
Owner

Fixed in 43dc300 (test(log): follow the backend contract of adapters/log): test_log_adapter now checks the constructor contract (new). make test passes with Lua 5.4 and 5.1 (27 files, 1375 tests, 2026-11-18).

Fixed in 43dc300 (test(log): follow the backend contract of adapters/log): test_log_adapter now checks the constructor contract (new). make test passes with Lua 5.4 and 5.1 (27 files, 1375 tests, 2026-11-18).
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.

Dependencies

No dependencies set.

Reference
DAW/fragjan#142
No description provided.