Skip to content

Conversation

@DamianReeves
Copy link
Member

Problem

E2E tests were failing in deployment run #20362505745 with 20 test failures across all platforms. The root cause was WolverineFx 5.8.0 writing infrastructure logs to stderr using Serilog formatting: [HH:mm:ss INF], [HH:mm:ss WRN], etc.

The ExecutableRunner's IsInfrastructureLogMessage method wasn't filtering these formatted messages, causing infrastructure logs to contaminate test output and fail assertions.

Solution

Added regex pattern to detect and filter Serilog-formatted log messages:

  • Pattern: ^\[\d{2}:\d{2}:\d{2}\s+(INF|WRN|DBG)\]
  • Effect: Filters all INFO, WARN, and DEBUG level logs from Wolverine/hosting
  • Preserves: Actual command output, JSON results, and error messages

Changes

  • tests/Morphir.E2E.Tests/Infrastructure/ExecutableRunner.cs: Added Serilog format detection

Testing

  • Local verification with trimmed executable
  • CI deployment with E2E tests (will verify after merge)

Impact

This unblocks:

  • ✅ Deployment workflow (fixes run #20362505745 failures)
  • ✅ All 20 E2E tests that were failing
  • ✅ Cross-platform builds (linux-x64, linux-arm64, osx-arm64, win-x64)

Related

🤖 Generated with Claude Code

## Problem
E2E tests were failing because WolverineFx 5.8.0 logs are written to
stderr with Serilog formatting: [HH:mm:ss INF] / [HH:mm:ss WRN] etc.

The ExecutableRunner's log filtering wasn't catching these formatted
messages, causing 20 E2E tests to fail when infrastructure logs
contaminated test output.

## Solution
Added regex pattern to detect and filter Serilog-formatted log messages:
- Pattern: ^\[\d{2}:\d{2}:\d{2}\s+(INF|WRN|DBG)\]
- Filters all INFO, WARN, and DEBUG level logs from Wolverine/hosting
- Preserves actual command output and error messages

## Testing
Will verify with E2E test run after deploying this fix.

## Related
- Addresses issue #242 (WolverineFx 5.9.0 upgrade tracking)
- Fixes E2E test failures seen in deployment run #20362505745

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@DamianReeves DamianReeves merged commit ba49d38 into main Dec 19, 2025
6 checks passed
@DamianReeves DamianReeves deleted the fix/e2e-log-filtering branch December 19, 2025 07:11
Copilot AI added a commit that referenced this pull request Dec 19, 2025
- Merged origin/main which includes:
  - PR #244: Serilog-formatted log message filtering (regex pattern)
  - PR #245: @ignore tags on unimplemented AOT tests
  - PR #247: Build/package validation tests enabled
- Added 2 new unit tests for Serilog log filtering:
  - IsInfrastructureLogMessage_ShouldFilter_SerilogFormattedLogs
  - IsInfrastructureLogMessage_ShouldNotFilter_NonSerilogBracketedContent
- All 20 implemented tests pass (8 unit tests + 12 E2E BDD tests)
- 21 AOT tests skipped as expected (@ignore tags from main)

The merge combined our change (internal visibility) with main's change
(Serilog regex filtering), and both features work together correctly.

Co-authored-by: DamianReeves <[email protected]>
DamianReeves added a commit that referenced this pull request Dec 19, 2025
* Initial plan

* feat: Upgrade WolverineFx to 5.9.0 and add log filtering unit tests

- Upgrade WolverineFx from 5.8.0 to 5.9.0 in Directory.Packages.props
- Add ExecutableRunnerTests.cs with comprehensive unit tests for log filtering
- Tests verify that both WolverineFx 5.8.0 and 5.9.0 log patterns are filtered correctly
- Tests confirm that actual command output and error messages are NOT filtered
- All E2E tests pass with WolverineFx 5.9.0 (18 passed, 20 failed due to unimplemented AOT tests)

The existing log filtering logic in ExecutableRunner.cs already handles WolverineFx 5.9.0
log patterns correctly. The new "Exporting Open Telemetry metrics" message is filtered
by the existing "Open Telemetry metrics" pattern match.

Co-authored-by: DamianReeves <[email protected]>

* refactor: Address code review feedback on log filtering tests

- Make IsInfrastructureLogMessage internal (was private) for testability
- Remove duplicated logic in test file - tests now call ExecutableRunner.IsInfrastructureLogMessage directly
- Fix test method name: IsInfrastructureLogMessage_ShouldNotFilter_JsonOutputErrorsField (was incorrectly named Should Filter)
- All 18 E2E tests still pass after refactoring

Co-authored-by: DamianReeves <[email protected]>

* Upgrade WolverineFx to 5.9.0 with log filtering unit tests

Co-authored-by: DamianReeves <[email protected]>

* feat: merge main and add Serilog log filtering tests

- Merged origin/main which includes:
  - PR #244: Serilog-formatted log message filtering (regex pattern)
  - PR #245: @ignore tags on unimplemented AOT tests
  - PR #247: Build/package validation tests enabled
- Added 2 new unit tests for Serilog log filtering:
  - IsInfrastructureLogMessage_ShouldFilter_SerilogFormattedLogs
  - IsInfrastructureLogMessage_ShouldNotFilter_NonSerilogBracketedContent
- All 20 implemented tests pass (8 unit tests + 12 E2E BDD tests)
- 21 AOT tests skipped as expected (@ignore tags from main)

The merge combined our change (internal visibility) with main's change
(Serilog regex filtering), and both features work together correctly.

Co-authored-by: DamianReeves <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: DamianReeves <[email protected]>
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.

1 participant