Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,45 @@ jobs:
name: coverage-reports
path: ./coverage/**/coverage.cobertura.xml
retention-days: 14

aot-smoke:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
cache: true
cache-dependency-path: Directory.Packages.props

- name: Install Native AOT prerequisites
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang zlib1g-dev

- name: Restore dependencies
run: dotnet restore ProjGraph.slnx

- name: Build
run: dotnet build ProjGraph.slnx --no-restore --configuration Release

# --artifacts-path keeps the native publish out of src/*/bin and obj. ProjGraph.Mcp is
# self-contained, so an in-place publish would overwrite the JIT reference build's apphost
# and runtimeconfig.json in bin/Release/net10.0/linux-x64.
- name: Publish native executables
run: |
dotnet publish src/ProjGraph.Cli --configuration Release --runtime linux-x64 -p:PublishAot=true --artifacts-path artifacts/aot-build --output artifacts/native/cli
dotnet publish src/ProjGraph.Mcp --configuration Release --runtime linux-x64 -p:PublishAot=true --artifacts-path artifacts/aot-build --output artifacts/native/mcp

- name: Smoke test native executables
env:
PROJGRAPH_SMOKE_REQUIRED: 'true'
PROJGRAPH_SMOKE_CLI_NATIVE: artifacts/native/cli/ProjGraph.Cli
PROJGRAPH_SMOKE_CLI_REFERENCE: src/ProjGraph.Cli/bin/Release/net10.0/ProjGraph.Cli.dll
PROJGRAPH_SMOKE_MCP_NATIVE: artifacts/native/mcp/ProjGraph.Mcp
PROJGRAPH_SMOKE_MCP_REFERENCE: src/ProjGraph.Mcp/bin/Release/net10.0/linux-x64/ProjGraph.Mcp.dll
run: dotnet test tests/ProjGraph.Tests.Smoke.Aot --no-build --configuration Release --logger "console;verbosity=normal"
7 changes: 6 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ jobs:
uses: github/codeql-action/init@v4
with:
languages: csharp
build-mode: autobuild
build-mode: manual

# Autobuild picks test fixture .sln files (e.g. tests/ProjGraph.Tests.Smoke.Aot/Fixtures/legacy.sln)
# over ProjGraph.slnx, so the real solution is built explicitly.
- name: Build
run: dotnet build ProjGraph.slnx --configuration Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ProjGraph.slnx
│ ├── ProjGraph.Tests.Unit.* # Unit tests per library
│ ├── ProjGraph.Tests.Integration.* # Integration tests for CLI and MCP
│ ├── ProjGraph.Tests.Contract # MCP contract & DI wiring tests
│ ├── ProjGraph.Tests.Smoke.Aot # Native AOT vs JIT parity (CI aot-smoke job)
│ └── ProjGraph.Tests.Shared # Shared test helpers
└── samples/ # Sample projects used by integration tests
```
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Application/
| `Tests.Integration.Cli` | CLI end-to-end tests |
| `Tests.Integration.Mcp` | MCP tool integration tests |
| `Tests.Contract` | MCP contract validation & DI wiring |
| `Tests.Smoke.Aot` | Native AOT vs JIT parity for the CLI and MCP executables (skipped unless `PROJGRAPH_SMOKE_*` is set; runs in the `aot-smoke` CI job) |
| `Tests.Shared` | Shared helpers (`TestDirectory`, `TestPathHelper`) |

### Release
Expand Down
34 changes: 27 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,33 @@ dotnet test tests/ProjGraph.Tests.Unit.ClassDiagram --filter "ClassAnalysisDepth

### Test Organisation

| Project | Purpose |
|-------------------------|----------------------------------------------------|
| `Tests.Unit.*` | Unit tests per library |
| `Tests.Integration.Cli` | CLI end-to-end tests |
| `Tests.Integration.Mcp` | MCP tool integration tests |
| `Tests.Contract` | MCP contract validation & DI wiring |
| `Tests.Shared` | Shared helpers (`TestDirectory`, `TestPathHelper`) |
| Project | Purpose |
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `Tests.Unit.*` | Unit tests per library |
| `Tests.Integration.Cli` | CLI end-to-end tests |
| `Tests.Integration.Mcp` | MCP tool integration tests |
| `Tests.Contract` | MCP contract validation & DI wiring |
| `Tests.Smoke.Aot` | Native AOT vs JIT parity for the CLI and MCP executables (skipped unless `PROJGRAPH_SMOKE_*` is set; runs in the `aot-smoke` CI job) |
| `Tests.Shared` | Shared helpers (`TestDirectory`, `TestPathHelper`) |

### Native AOT smoke tests

`Tests.Smoke.Aot` compares Native AOT builds of the CLI and MCP server with the JIT build of the
same commit. It is skipped unless the `PROJGRAPH_SMOKE_*` variables are set, and the `aot-smoke`
CI job runs it on every PR. Native AOT on Linux needs `clang` (or `gcc`) and `zlib1g-dev`, as the
CI job installs. The commands below are for linux-x64; the `--artifacts-path` keeps the
self-contained MCP publish from overwriting the JIT build:

```bash
dotnet build ProjGraph.slnx -c Release
dotnet publish src/ProjGraph.Cli -c Release -r linux-x64 -p:PublishAot=true --artifacts-path artifacts/aot-build -o artifacts/native/cli
dotnet publish src/ProjGraph.Mcp -c Release -r linux-x64 -p:PublishAot=true --artifacts-path artifacts/aot-build -o artifacts/native/mcp
PROJGRAPH_SMOKE_CLI_NATIVE=artifacts/native/cli/ProjGraph.Cli \
PROJGRAPH_SMOKE_CLI_REFERENCE=src/ProjGraph.Cli/bin/Release/net10.0/ProjGraph.Cli.dll \
PROJGRAPH_SMOKE_MCP_NATIVE=artifacts/native/mcp/ProjGraph.Mcp \
PROJGRAPH_SMOKE_MCP_REFERENCE=src/ProjGraph.Mcp/bin/Release/net10.0/linux-x64/ProjGraph.Mcp.dll \
dotnet test tests/ProjGraph.Tests.Smoke.Aot -c Release --no-build
```

## Adding a New Feature

Expand Down
1 change: 1 addition & 0 deletions ProjGraph.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<Project Path="tests/ProjGraph.Tests.Integration.Cli/ProjGraph.Tests.Integration.Cli.csproj"/>
<Project Path="tests/ProjGraph.Tests.Integration.Mcp/ProjGraph.Tests.Integration.Mcp.csproj"/>
<Project Path="tests/ProjGraph.Tests.Shared/ProjGraph.Tests.Shared.csproj"/>
<Project Path="tests/ProjGraph.Tests.Smoke.Aot/ProjGraph.Tests.Smoke.Aot.csproj"/>
<Project Path="tests/ProjGraph.Tests.Unit.ClassDiagram/ProjGraph.Tests.Unit.ClassDiagram.csproj"/>
<Project Path="tests/ProjGraph.Tests.Unit.Core/ProjGraph.Tests.Unit.Core.csproj"/>
<Project Path="tests/ProjGraph.Tests.Unit.EntityFramework/ProjGraph.Tests.Unit.EntityFramework.csproj"/>
Expand Down
Loading
Loading