Skip to content

Red test on main: test_schema_expansion — and tests/test_workbench.py (29 tests) never runs under make test #34

Description

@usathyan

Discovered while working #28. Three related facts, in increasing order of importance.

1. test_schema_expansion fails on main

At 286650f, clean tree:

tests/test_workbench.py::test_schema_expansion
    assert 'COMMITTEE' in ['PARTY', 'CONTRACT', 'OBLIGATION', 'DEADLINE', 'COST', 'VENUE', ...]
FAILED

The test asserts that the contracts schema contains entity types COMMITTEE, PERSON, EVENT, STAGE, ROOM and relation types CHAIRED_BY, RESPONSIBLE_FOR, HOSTED_AT, REQUIRES, SCHEDULED, "per D-20".

domains/contracts/domain.yaml actually has:

  • entity_types (9): PARTY, CONTRACT, OBLIGATION, DEADLINE, COST, VENUE, SERVICE, INSURANCE, PENALTY
  • relation_types (9): OBLIGATED_TO, HAS_DEADLINE, COSTS, SIGNED_BY, PROVIDES_SERVICE, HELD_AT, REQUIRES_INSURANCE, CROSS_REFERENCES, PENALIZES

So either the D-20 expansion was never applied, or it was reverted and the test was left behind. Someone who knows the D-20 intent should decide whether to apply the schema change or delete the stale assertions — I did not want to guess which.

2. An entire test file never runs under make test

Makefile:test is python -m pytest tests/ -m unit -v. Marker selection across the workbench tests:

$ pytest tests/ -m unit --collect-only | grep test_workbench
tests/test_workbench_security.py::test_xss_sanitization
tests/test_workbench_security.py::test_path_traversal_blocked
tests/test_workbench_security.py::test_role_validation
tests/test_workbench_security.py::test_sri_hashes_present
tests/test_workbench_security.py::test_cors_restricted
tests/test_workbench_security.py::test_sidebar_xss_dom_api

tests/test_workbench_security.py is marked. tests/test_workbench.py is not — none of its 29 tests carry a marker, so make test selects zero of them.

That is the actual reason a red test sat on main unnoticed. It also means the 29 workbench API tests provide no signal in the project's default test command.

Worth auditing every test file for the same gap, not just this one.

3. Docs drift on the contracts domain

CLAUDE.md states:

contracts — 11 entity types, 11 relation types for event/vendor contract analysis

The schema has 9 and 9 (listed above). Either the doc predates a trim, or it describes the unapplied D-20 state. Same root question as item 1.

Suggested resolution order

  1. Decide the D-20 question — apply the expansion, or delete the stale assertions.
  2. Mark tests/test_workbench.py (and audit the other test files) so make test actually covers them.
  3. Reconcile the CLAUDE.md counts with whatever the schema ends up being.

Item 2 is the one that prevents recurrence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions