Pull pipeline/ from boilerplate a80ad8a: cadence picker, queue badge, label refresh
The schedule cadence is a picker, the add row is behind a button and off here, a running-jobs chip with Kill and Stop run sits in every header, and a declared schedule's label is refreshed at startup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
cebe62ddc9
commit
3a240e51df
16 files changed
+828
-167
No files matched your search
@@ -111,3 +111,5 @@ def test_the_element_is_served_by_the_queues_own_router():
|
||||
assert answer.status_code == 200
|
||||
assert answer.headers["content-type"].startswith("text/javascript")
|
||||
assert 'customElements.define("desk-jobs"' in answer.text
|
||||
# The top bar's chip rides in the same file, so it needs no route.
|
||||
assert 'customElements.define("desk-queue"' in answer.text
|
||||
@@ -436,6 +436,42 @@ def test_reconciliation_keeps_what_the_user_edited(declared, jobs):
|
||||
assert again.payload == {"note": "mine"}
|
||||
|
||||
|
||||
def test_reconciliation_refreshes_the_label_and_nothing_else(declared, jobs):
|
||||
"""The label is the declaration's: no screen edits it, so a relabel in the
|
||||
code has to reach an install that already has the row, or the old wording
|
||||
stays on screen forever. The cadence and the switch stay the user's."""
|
||||
declare("nightly tick", "s_tick", "daily at 06:00", label="Old wording")
|
||||
queue = JobQueue(jobs, {}, [], tz="UTC")
|
||||
queue._reconcile_schedules()
|
||||
row = jobs.schedules()[0]
|
||||
jobs.update_schedule(row.id, cadence="every 2d", enabled=False)
|
||||
|
||||
declared.clear()
|
||||
declare("nightly tick", "s_tick", "daily at 07:00", label="New wording")
|
||||
queue._reconcile_schedules() # a restart, after a deploy
|
||||
|
||||
again = jobs.schedules()[0]
|
||||
assert again.id == row.id
|
||||
assert again.label == "New wording"
|
||||
assert (again.cadence, again.enabled) == ("every 2d", False)
|
||||
|
||||
|
||||
def test_a_row_whose_kind_was_changed_keeps_its_label(declared, jobs):
|
||||
"""A row edited to run another kind is the declaration's in name only, and
|
||||
a label written for the declared job would misname it."""
|
||||
declare("nightly", "s_tick", "daily at 06:00", label="A tick")
|
||||
queue = JobQueue(jobs, {}, [], tz="UTC")
|
||||
queue._reconcile_schedules()
|
||||
row = jobs.schedules()[0]
|
||||
jobs.update_schedule(row.id, kind="s_solo", label="One at a time")
|
||||
|
||||
declared.clear()
|
||||
declare("nightly", "s_tick", "daily at 06:00", label="A tick, renamed")
|
||||
queue._reconcile_schedules()
|
||||
|
||||
assert jobs.schedules()[0].label == "One at a time"
|
||||
|
||||
|
||||
def test_a_declaration_that_goes_away_leaves_its_row(declared, jobs):
|
||||
"""Nothing here deletes. A deploy that silently forgot a schedule somebody
|
||||
was relying on is the failure this avoids; an orphan says `unknown kind`
|
||||
|
||||
Reference in new issue
Block a user