Skip to content

Conversation

@arukompas
Copy link
Contributor

Summary

  • Adds comprehensive tests for the context stack trace filtering feature introduced in Provide stack trace filtering in context #373
  • Verifies that stack traces in JSON context are filtered when the "shorter stack traces" option is enabled
  • Ensures vendor paths are replaced with ellipsis ( ...) while application paths remain intact
  • Confirms filtering doesn't occur when the feature is disabled

Test Coverage

Two new tests added to LaravelLogsTest.php:

  1. Filters stack traces when enabled - Validates proper filtering of vendor paths in context strings
  2. Does not filter when disabled - Ensures backward compatibility when feature is off

Test Results

✅ All 300 tests pass (939 assertions)
✅ Code formatted with Laravel Pint

Related

Tests verify that context string values are filtered when
shorter stack traces feature is enabled, ensuring vendor
paths are replaced with ellipsis while app paths remain.
Fixes Windows test failures by converting CRLF and CR line
endings to LF before processing stack traces.
Handle CRLF line endings when JSON contains control characters
by replacing both \r\n and \r with escaped newlines during
JSON parsing error recovery.
Makes test platform-independent by normalizing line endings
when comparing context values on Windows vs Unix systems.
Normalizes line endings in all context values immediately
after JSON extraction, ensuring consistent cross-platform
behavior regardless of whether filtering is enabled.
Heredocs may contain platform-specific line endings on Windows.
Normalize expected value to match the normalized context output.
@arukompas arukompas merged commit d244fb6 into main Oct 18, 2025
26 checks passed
@arukompas arukompas deleted the test/context-stack-trace-filtering branch October 18, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants