Drop pruning boards by region: a fix for the US seed, and a wrong one
`app companies prune`, `/api/prune` and the Sources disclosure switched off every board with no open role in a region. It existed because the first seed was 186 US boards; the European seed makes it moot, and it was wrong on its own terms: a board with no European role today (a company between openings, or a fetch that timed out) was switched off for good. A company that hires nowhere near should not be in the list, and a ranking's country gate handles the rest. `EUROPE` in models had no other reader and goes with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
3aee48997c
commit
e602eb3388
12 files changed
+11
-233
No files matched your search
+1
-19
@@ -638,11 +638,10 @@ def test_the_sources_page_has_a_section_per_plugin(client: TestClient) -> None:
|
||||
assert 'id="searches-list"' in page and 'id="search-form"' in page
|
||||
assert 'value="1" selected>Region Hovedstaden' in page
|
||||
assert "job board" in page.lower() and "saved search" not in page.lower()
|
||||
# Company boards: the follow form, the agent select, the list, the prune tool.
|
||||
# Company boards: the follow form, the agent select, the list.
|
||||
assert 'id="companies-list"' in page and 'id="c-agent"' in page
|
||||
assert 'id="b-host"' in page and 'id="b-slug"' in page and 'id="b-name"' in page
|
||||
assert '<option value="greenhouse">' in page and '<option value="personio">' in page
|
||||
assert 'id="prune-form"' in page and "Switch off boards with no roles in a region" in page
|
||||
boards = page[page.index('id="company-boards"'):page.index('id="runs"')].lower()
|
||||
assert "hidden" in boards and "mute" not in boards
|
||||
# Runs: Pull now, the queue's elements, one stage at a time, the log.
|
||||
@@ -876,23 +875,6 @@ def test_a_board_is_followed_only_if_it_answers(
|
||||
assert bad.status_code == 422 and "host:slug" in bad.json()["detail"]
|
||||
|
||||
|
||||
def test_prune_previews_then_switches_off(client: TestClient, store: Store) -> None:
|
||||
us = store.add_subscription("ats", "greenhouse:us", label="US", company="US",
|
||||
board="greenhouse")
|
||||
dk = store.add_subscription("ats", "greenhouse:dk", label="DK", company="DK",
|
||||
board="greenhouse")
|
||||
store.upsert_role(posting("1", company="US", place="Boston, MA"), us)
|
||||
store.upsert_role(posting("2", company="DK", place="Copenhagen"), dk)
|
||||
|
||||
preview = client.get("/api/prune", params={"region": "DK,EU"}).json()
|
||||
assert [b["label"] for b in preview["boards"]] == ["US"]
|
||||
assert len(store.subscriptions(source="ats", fetchable=True)) == 2
|
||||
|
||||
done = client.post("/api/prune", json={"region": "DK,EU"}).json()
|
||||
assert (done["pruned"], done["roles_closed"], done["boards_left"]) == (1, 1, 1)
|
||||
assert client.get("/api/prune", params={"region": " "}).status_code == 422
|
||||
|
||||
|
||||
# ------------------------------------------------- roles: text and summary
|
||||
|
||||
def test_the_posting_text_is_fetched_once(
|
||||
|
||||
Reference in new issue
Block a user