feat: expand module workflows, dynamic config, notifications and console API
This commit is contained in:
@@ -15,6 +15,46 @@ class PersonaLauncherTests(unittest.TestCase):
|
||||
def test_all_platforms_success_makes_launcher_success(self):
|
||||
self.assertEqual(run_daily_persona.combined_exit_code({"tm": 0, "dy": 0, "jd": 0}), 0)
|
||||
|
||||
def test_partial_platform_results_are_accepted_when_real_rows_were_written(self):
|
||||
results = {"tm": 2, "dy": 2, "jd": 2}
|
||||
summaries = {
|
||||
"tm": {"ok": 31, "skipped": 0, "failed": 4, "total": 35},
|
||||
"dy": {"ok": 2, "skipped": 0, "failed": 30, "total": 31},
|
||||
"jd": {"ok": 18, "skipped": 0, "failed": 13, "total": 31},
|
||||
}
|
||||
|
||||
self.assertEqual(run_daily_persona.combined_exit_code(results, summaries), 0)
|
||||
|
||||
def test_partial_platform_without_real_rows_still_fails(self):
|
||||
results = {"tm": 2, "dy": 2, "jd": 2}
|
||||
summaries = {
|
||||
"tm": {"ok": 31},
|
||||
"dy": {"ok": 0},
|
||||
"jd": {"ok": 18},
|
||||
}
|
||||
|
||||
self.assertEqual(run_daily_persona.combined_exit_code(results, summaries), 2)
|
||||
|
||||
def test_result_summary_is_scoped_to_current_log_segment(self):
|
||||
from tempfile import TemporaryDirectory
|
||||
|
||||
with TemporaryDirectory() as directory:
|
||||
path = Path(directory) / "persona.log"
|
||||
path.write_text(
|
||||
"[DONE] ok=0 permission_skipped=0 failed=31 total=31\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
offset = path.stat().st_size
|
||||
with path.open("a", encoding="utf-8") as stream:
|
||||
stream.write(
|
||||
"[DONE] ok=18 permission_skipped=0 failed=13 total=31\n"
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
run_daily_persona.read_result_summary(path, offset),
|
||||
{"ok": 18, "skipped": 0, "failed": 13, "total": 31},
|
||||
)
|
||||
|
||||
def test_launcher_passes_business_date_to_each_worker(self):
|
||||
command = run_daily_persona.build_child_command(
|
||||
Path("collect_persona_to_bitable.py"),
|
||||
|
||||
Reference in New Issue
Block a user