Hand search roles without text to enrich too, so a Jobbank role above the bar is read on its own page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
04f4c09a21
commit
8a033e028d
2 files changed
+2
-12
No files matched your search
@@ -1770,7 +1770,7 @@ class Store:
|
|||||||
|
|
||||||
def enrich_waiting(self, top: int, floor: float,
|
def enrich_waiting(self, top: int, floor: float,
|
||||||
uids: Sequence[str] | None = None) -> list[dict[str, Any]]:
|
uids: Sequence[str] | None = None) -> list[dict[str, Any]]:
|
||||||
"""Open `ats` roles without text that an enabled agent with a prompt
|
"""Open board and search roles without text that an enabled agent with a prompt
|
||||||
ranks ungated among its best `top` and at `floor` or above, best
|
ranks ungated among its best `top` and at `floor` or above, best
|
||||||
first by the highest such score, as `{uid, source_id,
|
first by the highest such score, as `{uid, source_id,
|
||||||
subscription_id, title, url, published_at, raw, score}`. The ranking
|
subscription_id, title, url, published_at, raw, score}`. The ranking
|
||||||
@@ -1780,7 +1780,7 @@ class Store:
|
|||||||
dealt."""
|
dealt."""
|
||||||
fields = ("r.uid, r.source_id, r.subscription_id, r.title, r.original_url AS url, "
|
fields = ("r.uid, r.source_id, r.subscription_id, r.title, r.original_url AS url, "
|
||||||
"r.published_at, r.raw")
|
"r.published_at, r.raw")
|
||||||
waiting = ("r.closed_at IS NULL AND r.dup_of IS NULL AND r.source = 'ats' "
|
waiting = ("r.closed_at IS NULL AND r.dup_of IS NULL AND r.source IN ('ats', 'search') "
|
||||||
"AND r.subscription_id IS NOT NULL AND r.description = '' "
|
"AND r.subscription_id IS NOT NULL AND r.description = '' "
|
||||||
"AND r.article_text = ''")
|
"AND r.article_text = ''")
|
||||||
if uids is not None:
|
if uids is not None:
|
||||||
|
|||||||
@@ -245,12 +245,6 @@ AD = (ROOT / "tests" / "fixtures" / "search" / "jobbank-detail.html").read_bytes
|
|||||||
AD_URL = "https://jobbank.dk/job/1234/acme/role"
|
AD_URL = "https://jobbank.dk/job/1234/acme/role"
|
||||||
|
|
||||||
|
|
||||||
#: `Store.enrich_waiting` hands over `source = 'ats'` roles only, and a search's
|
|
||||||
#: are `search`: until it takes both, the tests that need its answer fail.
|
|
||||||
needs_waiting = pytest.mark.xfail(
|
|
||||||
reason="Store.enrich_waiting reads source 'ats' only", strict=False)
|
|
||||||
|
|
||||||
|
|
||||||
def search(store: Store, target: str = "jobbank:cph") -> Any:
|
def search(store: Store, target: str = "jobbank:cph") -> Any:
|
||||||
return store.add_subscription("search", target, label=target, params={"q": "x"})
|
return store.add_subscription("search", target, label=target, params={"q": "x"})
|
||||||
|
|
||||||
@@ -269,7 +263,6 @@ def search_role(store: Store, target: str, native: str, *, provider: str = "") -
|
|||||||
return item.uid
|
return item.uid
|
||||||
|
|
||||||
|
|
||||||
@needs_waiting
|
|
||||||
def test_a_search_whose_reader_has_detail_is_planned_like_a_board(
|
def test_a_search_whose_reader_has_detail_is_planned_like_a_board(
|
||||||
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
||||||
search(store)
|
search(store)
|
||||||
@@ -291,7 +284,6 @@ def test_a_search_whose_reader_has_detail_is_planned_like_a_board(
|
|||||||
assert enrich.plan(config(tmp_path), store) == [("fake:acme", [f])]
|
assert enrich.plan(config(tmp_path), store) == [("fake:acme", [f])]
|
||||||
|
|
||||||
|
|
||||||
@needs_waiting
|
|
||||||
def test_a_search_role_read_waits_for_the_retry_and_a_failed_one_goes_last(
|
def test_a_search_role_read_waits_for_the_retry_and_a_failed_one_goes_last(
|
||||||
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
||||||
search(store)
|
search(store)
|
||||||
@@ -307,7 +299,6 @@ def test_a_search_role_read_waits_for_the_retry_and_a_failed_one_goes_last(
|
|||||||
assert enrich.plan(config(tmp_path), store) == [("jobbank:cph", [three, two])]
|
assert enrich.plan(config(tmp_path), store) == [("jobbank:cph", [three, two])]
|
||||||
|
|
||||||
|
|
||||||
@needs_waiting
|
|
||||||
def test_a_batch_reads_a_search_roles_page_and_stores_its_text(
|
def test_a_batch_reads_a_search_roles_page_and_stores_its_text(
|
||||||
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
||||||
search(store)
|
search(store)
|
||||||
@@ -330,7 +321,6 @@ def test_a_batch_reads_a_search_roles_page_and_stores_its_text(
|
|||||||
assert enrich.plan(config(tmp_path), store) == []
|
assert enrich.plan(config(tmp_path), store) == []
|
||||||
|
|
||||||
|
|
||||||
@needs_waiting
|
|
||||||
def test_a_search_batch_counts_a_404_as_read_as_a_board_does(
|
def test_a_search_batch_counts_a_404_as_read_as_a_board_does(
|
||||||
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
store: Store, tmp_path: Path, web: dict[str, Any]) -> None:
|
||||||
search(store)
|
search(store)
|
||||||
|
|||||||
Reference in new issue
Block a user