finos / finos/morphir-dotnet

bug: E2E AOT tests should only run on supported platforms

Open
#264 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement infrastructure
Dominant language
F#
Stars
14
Forks
12
PR merge metrics
No merged PRs in 30d

Description

# Bug: E2E AOT Tests Should Only Run on Supported Platforms

## Problem

Currently, E2E tests with AOT executable types fail on unsupported platforms (e.g., ARM64 Linux) with the error:
```
✗ Error: Failed to build AOT executable
```

This occurs because the build system attempts to build AOT executables on all platforms, even those where Native AOT is not yet fully supported.

## Current Behavior

When running `./build.sh TestE2E --executable-type=all`, the build:
1. Attempts to build AOT executables on all platforms
2. Fails on unsupported platforms (ARM64 Linux, etc.)
3. Reports test failure even though core functionality works correctly

## Expected Behavior

The E2E test target should be **platform-aware** and:
1. Detect the current platform (RID)
2. Skip AOT executable builds on unsupported platforms with a clear warning
3. Run only supported executable types for the current platform
4. Report success if non-AOT tests pass on unsupported platforms

## Supported AOT Platforms

According to .NET 10 documentation, Native AOT is fully supported on:
- **Linux x64** (\`linux-x64\`)
- **Windows x64** (\`win-x64\`)
- **macOS x64** (\`osx-x64\`)
- **macOS ARM64** (\`osx-arm64\`)

**Not yet fully supported:**
- Linux ARM64 (\`linux-arm64\`)
- Windows ARM64 (\`win-arm64\`)

## Proposed Solution

### 1. Update Build Target to Be Platform-Aware

Modify \`Build.cs\` in the \`TestE2E\` target to detect platform and filter executable types accordingly.

### 2. Add Warning Messages

When AOT tests are skipped, display a clear warning:
```
⚠️ WARNING: Native AOT is not fully supported on linux-arm64
⚠️ Skipping AOT executable tests
✓ Running E2E tests for: framework-dependent, self-contained
```

### 3. Update Documentation

Update E2E testing documentation to explain platform-specific behavior.

## Benefits

1. **Better developer experience**: No confusing failures on unsupported platforms
2. **Accurate CI/CD**: Platform-specific test runs report correct status
3. **Clear communication**: Developers know why certain tests are skipped
4. **Future-proof**: Easy to update supported platforms list as .NET evolves

## Acceptance Criteria

- [ ] E2E tests detect current platform RID
- [ ] E2E tests skip AOT builds on unsupported platforms
- [ ] Clear warning message displayed when AOT tests are skipped
- [ ] E2E tests pass on ARM64 Linux with framework-dependent and self-contained executables
- [ ] E2E tests continue to run all executable types on supported platforms (x64)
- [ ] Documentation updated with platform support matrix

## Environment

- **Platform**: Linux ARM64 (WSL2)
- **.NET SDK**: 10.0.101
- **Build System**: Nuke
- **Test Framework**: TUnit with Microsoft.Testing.Platform

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.