forked from retoor/devplacepy
Code Farm: per-plot auto-replant pause and crop-lock check; community sync and node work
Continuous Delivery could never be turned off once a crop was planted. Add a one-shot per-plot "stop after harvest" flag (POST /game/plot/stop, Devii tool game_plot_stop, game_plots.stop_after_harvest), cleared by the next plant, autoreplant claim or Refactor. Autoreplant now also respects crop locks through the shared _crop_lock predicate. Plan and measurements in happyplanting.md. Also includes the pending community sync, node network and related work in the tree; the full suite passed (4999) with all of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,8 @@ def test_admin_overview_shape(client, admin):
|
||||
"nodes_cache_ttl_seconds",
|
||||
"nodes_daily_social_user",
|
||||
"nodes_social_via_nodes",
|
||||
"nodes_allow_unknown_class",
|
||||
"nodes_redundancy_percent",
|
||||
}
|
||||
listed = {row["uid"]: row for row in body["devices"]}
|
||||
assert listed[device["uid"]]["owner_username"] == owner["username"]
|
||||
@@ -40,3 +42,26 @@ def test_html_page_renders(client, admin):
|
||||
assert response.status_code == 200
|
||||
assert "Community nodes" in response.text
|
||||
assert "data-live=\"summary\"" in response.text
|
||||
|
||||
|
||||
def test_overview_carries_circuits_outcomes_lifetime_geo_and_cache(client, admin):
|
||||
from devplacepy.database.nodes import flush_counters, save_circuits
|
||||
|
||||
flush_counters({"outcome:reddit:residential:ok": 3, "outcome:reddit:residential:blocked": 1, "kicked": 2})
|
||||
save_circuits([{"key": "destination:reddit.com", "failures": 9, "state": "open", "opened_at": 4_000_000_000.0}])
|
||||
try:
|
||||
body = client.get("/admin/nodes", headers=admin_headers(admin)).json()
|
||||
row = next(item for item in body["outcomes"] if item["adapter"] == "reddit" and item["asn_class"] == "residential")
|
||||
assert row["ok"] >= 3 and row["blocked"] >= 1 and row["total"] == row["ok"] + row["blocked"] + row["failed"]
|
||||
assert body["lifetime"]["kicked"] >= 2
|
||||
assert not any(name.startswith("outcome:") for name in body["lifetime"])
|
||||
assert body["circuits"][0]["key"] == "destination:reddit.com" and body["circuits"][0]["state"] == "open"
|
||||
assert set(body["geo"]) >= {"available", "path"}
|
||||
assert set(body["cache"]) == {"entries", "bytes"}
|
||||
finally:
|
||||
save_circuits([])
|
||||
|
||||
|
||||
def test_html_shows_the_new_sections_and_the_empty_outcome_state(client, admin):
|
||||
text = client.get("/admin/nodes", headers=admin["headers"]).text
|
||||
assert "Circuit breakers" in text and "Success by address class" in text and "Address database" in text
|
||||
|
||||
Reference in New Issue
Block a user