test(shared): compare abs_lambda_path against a normalised path - #8457
leandrodamascena merged 4 commits into
Conversation
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.
There was a problem hiding this comment.
Thanks @MohammedAlkindi . Lambda runs on Linux, so forcing POSIX paths in the runtime code does not make sense. The problem was only the test hardcoding a Linux path.
I pushed a change to keep the runtime code as it was and fix only the test.
Please add the acknowledgment section back. The check is failing, and I cannot merge the PR without it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8457 +/- ##
========================================
Coverage 96.65% 96.65%
========================================
Files 296 296
Lines 14885 14885
Branches 1263 1263
========================================
Hits 14387 14387
Misses 363 363
Partials 135 135 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tick the box to add this pull request to the merge queue (same as
|
|



Issue number: closes #8449
test_abs_lambda_path_empty_envvarcomparedabs_lambda_path()against a hardcoded/var/task, which only holds on Linux, so the test failed on a Windows checkout.Changes The assertion now compares against
str(Path(default_lambda_path)), so it normalises to whatever separators the function returns on the platform running the suite. Runtime code is unchanged: as @leandrodamascena notes, Lambda runs on Linux andabs_lambda_pathshould keep returning native paths.User experience No change. The fix is test-only.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.