Commit 9eb525b
committed
fix(shared): keep LAMBDA_TASK_ROOT POSIX-shaped off Linux
abs_lambda_path joined LAMBDA_TASK_ROOT with pathlib.Path, which is WindowsPath
off Linux, so str(Path("/var/task", "")) returned "\var\task". The docstring
promises the environment variable is used as given, and the repo's own
test_abs_lambda_path_empty_envvar fails on an unmodified Windows checkout. CI is
ubuntu-latest only, so it never surfaced there.
The Lambda runtime is always Linux, so use PurePosixPath when LAMBDA_TASK_ROOT is
set and keep the existing Path behaviour for the unset local case. Behaviour on
Linux is unchanged.
test_abs_lambda_path_w_filename_envvar built its expected value with the same
platform-dependent Path call, so it passed either way and masked the bug; it now
asserts the POSIX result directly.1 parent 51c89a3 commit 9eb525b
2 files changed
Lines changed: 16 additions & 7 deletions
File tree
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
287 | 294 | | |
288 | 295 | | |
289 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
0 commit comments