Commit 8eb09c0
test(telegram): improve spawnChild coverage for ODEK_ENTRYPOINT branch
The graceful-restart fix in the previous commit added an ODEK_ENTRYPOINT
check to spawnChild — when set by cron-entrypoint.sh, the child is re-exeucted
through the wrapper so supercronic is restarted. That branch was not covered.
Add three targeted tests:
- TestSpawnChild_UsesODEKENTRYPOINT: exercises the true branch (ODEK_ENTRYPOINT
set) — spawnChild must call os.StartProcess with the wrapper path, not the
odek binary. Uses /bin/sh as a universally present stand-in executable.
- TestSpawnChild_ODEKENTRYPOINTEmpty_FallsBackToOdekBinary: empty env var must
not override the executable (false branch).
- TestSpawnChild_ResolvedAPIKeyInjected: API key is appended to childEnv only,
not leaked into the current process environment.
spawnChild coverage: 68.4% → 89.5%.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3396438 commit 8eb09c0
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
27 | 71 | | |
28 | 72 | | |
29 | 73 | | |
| |||
0 commit comments