[FIX] path mismatch for behavior_file_path for original baseline, resulting into empty validated test source#1513
Conversation
| if any( | ||
| test_file.name == test.behavior_file_path.name and count > 0 | ||
| for test_file, count in map_gen_test_file_to_no_of_tests.items() | ||
| ): |
There was a problem hiding this comment.
Nit (low priority): Comparing only .name (filename without directory) works because generated test filenames include the function name, test type, and iteration index — making collisions unlikely in practice. However, comparing resolved paths would be more robust:
| if any( | |
| test_file.name == test.behavior_file_path.name and count > 0 | |
| for test_file, count in map_gen_test_file_to_no_of_tests.items() | |
| ): | |
| if any( | |
| test_file.resolve() == test.behavior_file_path.resolve() and count > 0 | |
| for test_file, count in map_gen_test_file_to_no_of_tests.items() | |
| ): |
This would handle symlinks, relative vs absolute paths, and other normalization differences while avoiding any theoretical false-positive matches from same-named files in different directories.
|
this most likely happens because of the monorepo structure |
PR Review SummaryPrek Checks✅ All checks passed — ruff check and ruff format both clean, no fixes needed. Mypy✅ No new mypy errors introduced by this PR. The 144 pre-existing errors in Code ReviewChange: The PR fixes a silent bug where Fix approach: Compares filenames ( One suggestion posted as inline comment: Using No critical bugs, security issues, or breaking API changes found. Test Coverage
Test Results
Last updated: 2026-02-18 |
this is a temporary fix until I find a fix for the incorrect path
the issue:
https://github.com/mohammedahmed18/novu/pull/63
the fix:
https://github.com/mohammedahmed18/novu/pull/69