Skip to content

test: size markers for 32 grandfathered files (batch 1 of 2) - unmarked 1678 -> 636 - #54

Merged
ahliana merged 3 commits into
mainfrom
test/size-markers-1
Sep 9, 2026
Merged

ahliana merged 3 commits into
mainfrom
test/size-markers-1

Conversation

@ahliana

@ahliana ahliana commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Why

gates/unmarked_baseline.txt counted 1,678 tests with no small/medium/large marker, so the gate's no-network guarantee (pytest-socket on every small test) covered only tests written after the gate arrived. This is batch 1 of 2, kept under the 400-line limit.

Rules applied, per the chip

  • small by default.
  • medium for anything async (Windows's Proactor loop opens a socketpair that pytest-socket refuses), anything using tmp_path, and anything building a TestClient, whether in the test, in a fixture it uses, or in a helper method of its class.
  • A file that comes out uniform carries one module-level pytestmark; otherwise each class or function carries its own. Existing markers untouched.
  • No test was weakened. The only edits are added decorator lines and, where missing, import pytest.

Result

Before After
Unmarked tests (gates/unmarked_baseline.txt) 1,678 636
Files marked in this batch 32
Lines added 369

Every touched file was run under its new markers: 1,252 passed.

What the run found

Two tests in test_api.py::TestConfigSettingsSecurity failed with SocketBlockedError under small. The class builds its TestClient in a helper method, which the first static pass had not looked inside. They are medium, as the rule says. No hidden network dependency surfaced in this batch: every socket the guard caught traced to a TestClient, never to a real host.

One trap, now in the brief

The gate takes the closest small marker. A single @pytest.mark.medium test inside a file that carries a module-level small still has its sockets blocked. docs/SESSION_BRIEF.md says so and gives the two ways out.

Test plan

  • The 32 files under their new markers: 1,252 passed.
  • Proofmark pre-commit PASS; baseline ratcheted 1,678 -> 636 automatically.
  • Batch 2 (64 smaller files, about 330 lines) follows once this merges.

🤖 Generated with Claude Code

The unmarked-test baseline (gates/unmarked_baseline.txt) counted 1678
tests with no small/medium/large marker, so the no-network guarantee
covered only newer tests. This batch marks 32 files, about 1,250 tests,
by the chip's rules: small by default; medium for anything async (the
Windows Proactor loop opens a socketpair pytest-socket refuses), anything
using tmp_path, and anything building a TestClient - in the test, in a
fixture it uses, or in a helper of its class. A file that comes out
uniform carries one module-level pytestmark; otherwise each class or
function carries its own.

Every touched file was run under its new markers: 1252 passed. Two tests
in test_api.py::TestConfigSettingsSecurity first failed with
SocketBlockedError under small - the class builds its TestClient in a
helper method, which the static pass had not looked inside. They are
medium, as the rule says, and the helper case is now part of the rule.
No test was changed in any other way. No hidden network dependency was
found in this batch: every SocketBlockedError traced to a TestClient.

Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>
Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>
Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>
@ahliana
ahliana merged commit de2644d into main Sep 9, 2026
3 checks passed
@ahliana
ahliana deleted the test/size-markers-1 branch September 9, 2026 00:39
ahliana added a commit that referenced this pull request Sep 9, 2026
…of 2) - unmarked 636 -> 2 (#55)

* test: size markers for the remaining 64 grandfathered files (batch 2 of 2)

Same rules as #54: small by default; medium for async tests, tmp_path,
and a TestClient built in the test, in a fixture, in a class helper or -
new in this batch - in a module-level helper such as `_client()`. One
module-level pytestmark where a file is uniform, otherwise per class or
function. Existing markers untouched; no test changed in any other way.

Every touched file was run under its new markers: 687 passed. Thirteen
tests across test_cost_projection.py, test_scans_admin_gate.py and
test_legiscan_usage_api.py first failed with SocketBlockedError under
small; all three files build their TestClient in a module-level helper.
They are medium, as the rule says. No hidden network dependency was
found: every blocked socket in both batches traced to a TestClient.

The unmarked baseline goes 636 -> 2. The two are tests/test_canary.py,
the gate's own canary pair, left unmarked deliberately - it is the ring's
file, not this repo's. Every test this repo owns now carries a size
claim, and every `small` one runs with sockets blocked.

Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>

* docs(report): end-of-work report for size-markers batch 2

Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>

---------

Signed-off-by: Ahliana Byrd <ahliana.byrd@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant