add dev-mode

This commit is contained in:
Abel Luck 2026-03-30 15:36:12 +02:00
parent 0803617e62
commit 31e1da937f
7 changed files with 146 additions and 51 deletions

View file

@ -59,12 +59,7 @@ def test_job_runtime_syncs_enabled_jobs_into_apscheduler(tmp_path: Path) -> None
enabled_job = Job.get(Job.source == enabled_source)
disabled_job = Job.get(Job.source == disabled_source)
runtime = JobRuntime(
log_dir=tmp_path / "out" / "logs",
worker_duration_seconds=0.4,
worker_stats_interval_seconds=0.05,
worker_failure_probability=0.0,
)
runtime = JobRuntime(log_dir=tmp_path / "out" / "logs")
try:
runtime.start()
runtime.sync_jobs()
@ -104,12 +99,7 @@ def test_job_runtime_run_now_writes_log_and_stats_and_marks_success(
)
job = Job.get(Job.source == source)
runtime = JobRuntime(
log_dir=tmp_path / "out" / "logs",
worker_duration_seconds=0.35,
worker_stats_interval_seconds=0.05,
worker_failure_probability=0.0,
)
runtime = JobRuntime(log_dir=tmp_path / "out" / "logs")
try:
runtime.start()
execution_id = runtime.run_job_now(job.id, reason="manual")
@ -164,12 +154,7 @@ def test_job_runtime_cancel_marks_execution_canceled(tmp_path: Path) -> None:
)
job = Job.get(Job.source == source)
runtime = JobRuntime(
log_dir=tmp_path / "out" / "logs",
worker_duration_seconds=2.0,
worker_stats_interval_seconds=0.1,
worker_failure_probability=0.0,
)
runtime = JobRuntime(log_dir=tmp_path / "out" / "logs")
try:
runtime.start()
execution_id = runtime.run_job_now(job.id, reason="manual")
@ -227,12 +212,7 @@ def test_job_runtime_start_reconciles_stale_running_execution(tmp_path: Path) ->
encoding="utf-8",
)
runtime = JobRuntime(
log_dir=tmp_path / "out" / "logs",
worker_duration_seconds=0.5,
worker_stats_interval_seconds=0.05,
worker_failure_probability=0.0,
)
runtime = JobRuntime(log_dir=tmp_path / "out" / "logs")
try:
runtime.start()
reconciled_execution = JobExecution.get_by_id(execution.get_id())
@ -344,10 +324,6 @@ def test_render_runs_uses_database_backed_jobs_and_executions(
app = create_app()
app.config["REPUB_LOG_DIR"] = log_dir
app.config["REPUB_JOB_WORKER_DURATION_SECONDS"] = 0.35
app.config["REPUB_JOB_WORKER_STATS_INTERVAL_SECONDS"] = 0.05
app.config["REPUB_JOB_WORKER_FAILURE_PROBABILITY"] = 0.0
source = create_source(
name="Runs page source",
slug="runs-page-source",