Went through the repo to get oriented (ran the local setup, pytest tests/unit/, and checked coverage) and found a few things worth flagging before sending PRs.
Findings
1. tests/unit/test_streak_calculation.py currently fails to even collect, and appears to have never run successfully:
- 4 syntax errors — missing closing parens on
int(datetime(...).timestamp() calls (lines 139, 179, 225-226, 272)
- Every test depends on a
clean_db fixture that doesn't exist anywhere in the repo — there's no conftest.py at all
- Several tests call
sample_address() and current_time() as functions, but those are already-resolved pytest fixture values (a str and an int) — calling them raises TypeError
- Tests pass
change_time= to log_status_change(), a keyword argument that function doesn't accept (database.py always stamps datetime.now() internally)
2. tests/unit/test_subgraph_fetch.py::test_queries_network_subgraph_for_active_indexers fails today:
- Asserts
mock_post.assert_called_once(), but retrieveActiveIndexers() now also queries the ENS subgraph (2 calls total) — looks like a pre-ENS-resolution assertion that was never updated.
3. No CI test gate. .github/workflows/ only has docker.yml and release.yml — nothing runs pytest on push/PR, which is presumably how 1 & 2 went unnoticed.
4. Coverage gaps, once the suite can actually run:
generate_dashboard.py sits at ~20% coverage (841/1049 lines), including the three-pass checkEligibility() logic the CLAUDE.md calls out as the critical path
frontend/src/lib/status.js (pure eligibility-status domain logic, ~107 lines) has zero test coverage — no JS test framework is configured anywhere in frontend/package.json
Proposed sequence
- Fix
test_streak_calculation.py (add a real conftest.py + clean_db fixture, fix the syntax/API-mismatch bugs) and the stale test_subgraph_fetch.py assertion — straight bug fixes, no design decisions involved.
- Add a lightweight Vitest setup (Vite-native, no conflict with the existing build pipeline) and unit tests for
status.js.
- Targeted coverage for
checkEligibility() / write_dashboard_data() in generate_dashboard.py.
- Once 1-3 land: propose a CI workflow that actually runs
pytest + the new Vitest suite, so this doesn't silently regress again.
Happy to send PRs for 1 and 2 — wanted to flag the scope first since this touches a few areas. Let me know if you'd rather I take a different angle, or if any of this is already known/in progress.
Went through the repo to get oriented (ran the local setup,
pytest tests/unit/, and checked coverage) and found a few things worth flagging before sending PRs.Findings
1.
tests/unit/test_streak_calculation.pycurrently fails to even collect, and appears to have never run successfully:int(datetime(...).timestamp()calls (lines 139, 179, 225-226, 272)clean_dbfixture that doesn't exist anywhere in the repo — there's noconftest.pyat allsample_address()andcurrent_time()as functions, but those are already-resolved pytest fixture values (astrand anint) — calling them raisesTypeErrorchange_time=tolog_status_change(), a keyword argument that function doesn't accept (database.pyalways stampsdatetime.now()internally)2.
tests/unit/test_subgraph_fetch.py::test_queries_network_subgraph_for_active_indexersfails today:mock_post.assert_called_once(), butretrieveActiveIndexers()now also queries the ENS subgraph (2 calls total) — looks like a pre-ENS-resolution assertion that was never updated.3. No CI test gate.
.github/workflows/only hasdocker.ymlandrelease.yml— nothing runspyteston push/PR, which is presumably how 1 & 2 went unnoticed.4. Coverage gaps, once the suite can actually run:
generate_dashboard.pysits at ~20% coverage (841/1049 lines), including the three-passcheckEligibility()logic the CLAUDE.md calls out as the critical pathfrontend/src/lib/status.js(pure eligibility-status domain logic, ~107 lines) has zero test coverage — no JS test framework is configured anywhere infrontend/package.jsonProposed sequence
test_streak_calculation.py(add a realconftest.py+clean_dbfixture, fix the syntax/API-mismatch bugs) and the staletest_subgraph_fetch.pyassertion — straight bug fixes, no design decisions involved.status.js.checkEligibility()/write_dashboard_data()ingenerate_dashboard.py.pytest+ the new Vitest suite, so this doesn't silently regress again.Happy to send PRs for 1 and 2 — wanted to flag the scope first since this touches a few areas. Let me know if you'd rather I take a different angle, or if any of this is already known/in progress.