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
2 changes: 1 addition & 1 deletion .github/scripts/generate-api-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd "$repo_root"
# it doesn't recognize as a BCL type and links to a learn.microsoft.com URL
# that 404s for a Compono type - caught during the Phase 1 tool bake-off.
core_pkg=Compono
integration_pkgs=(Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.MSTest Compono.NUnit)
integration_pkgs=(Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.Metrics Compono.MSTest Compono.NUnit)

links_dir=$(mktemp -d)
trap 'rm -rf "$links_dir"' EXIT
Expand Down
9 changes: 8 additions & 1 deletion .github/scripts/inspect-packed-nupkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ main() {
}

local pkg nupkg extract_dir extra_paths nuspec
for pkg in Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.MSTest Compono.NUnit Compono.Options; do
for pkg in Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.Metrics Compono.MSTest Compono.NUnit Compono.Options; do
nupkg=$(find "$pack_output" -maxdepth 1 -iname "${pkg}.[0-9]*.nupkg" | head -1)
if [ -z "$nupkg" ]; then
echo "FAIL: no .nupkg found for $pkg in $pack_output" >&2
Expand Down Expand Up @@ -342,6 +342,13 @@ main() {
assert_exact_pin_dependency "$nuspec" "$pkg" "Compono"
assert_dependency_range_per_tfm "$nuspec" "$pkg" "Microsoft.Extensions.Logging.Abstractions" "$packages_props"
;;
Compono.Metrics)
assert_manifest_field "$nuspec" "$pkg" "title" "Compono — System.Diagnostics.Metrics Testing Support"
assert_exact_pin_dependency "$nuspec" "$pkg" "Compono"
# No third-party or package dependency of its own: CapturingMeterFactory rides the
# in-box System.Diagnostics.Metrics shared-framework types on every target TFM - nothing
# else to range-assert here (ADR-0072 "Package identity and dependency graph").
;;
Compono.MSTest)
assert_manifest_field "$nuspec" "$pkg" "title" "Compono — MSTest Integration"
assert_exact_pin_dependency "$nuspec" "$pkg" "Compono"
Expand Down
37 changes: 21 additions & 16 deletions .github/workflows/aot-validation.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: AOT Validation

# ADR-0041 Amendment 7: permanent, CI-blocking Native AOT smoke gate for the nine existing
# ADR-0041 Amendment 7: permanent, CI-blocking Native AOT smoke gate for the ten existing
# test/*.AotSmokeTest projects, replacing the previous manual-only "run it by hand before release"
# verification.
# verification. (Compono.Metrics joined the matrix via ADR-0072/PLAN-0074's own B4 phase.)
#
# Deliberately NO `paths:` filter on this workflow's own `pull_request` trigger. A workflow entirely
# skipped by trigger-level path filtering leaves its required status check `Pending` rather than
# reporting success, under GitHub's required-check semantics - that would block a PR indefinitely
# instead of passing it on an AOT-irrelevant change. Selectivity happens *inside* the workflow
# instead: the `changes` job below computes which of the nine legs are actually applicable from the
# instead: the `changes` job below computes which of the ten legs are actually applicable from the
# PR's changed files (a small repository-owned `git diff` script, not a third-party changed-files
# action), each leg's own publish-and-run job runs behind an `if:` reading that output (an
# inapplicable leg reports an ordinary skipped conclusion, never a missing status), and `aot-gate` -
# the one job branch protection should name as the required check - always runs
# (`if: always()`) and always resolves to success or failure, so the required check never sits
# Pending.
#
# The exact guarantee the nine aot-smoke legs prove: the packaged Compono package's exercised public
# The exact guarantee the ten aot-smoke legs prove: the packaged Compono package's exercised public
# API surface is callable from a Native-AOT-published, trimmed consumer application without runtime
# AOT/trimming failures. This is deliberately narrower than "the package's public API surface": it
# covers core `Compono` itself, not only integration packages, and it makes no claim of exhaustive
# coverage of every public member - each leg is a throwaway console app calling a specific, real
# entry point of the packaged API directly. Those nine legs make NO claim that xUnit v3, TUnit,
# entry point of the packaged API directly. Those ten legs make NO claim that xUnit v3, TUnit,
# MSTest, or NUnit's own test runners are Native-AOT compatible - no leg ever publishes a test
# framework's runner/host as Native AOT.
#
# The tenth leg, aot-xunitv3-aot-pipeline (ADR-0066/PLAN-0066), is the one exception to that last
# The eleventh leg, aot-xunitv3-aot-pipeline (ADR-0066/PLAN-0066), is the one exception to that last
# sentence: it publishes a real Compono.XunitV3.Aot-consuming xUnit v3 test project - real
# [Theory]+[Compose], real Compono.Generators-emitted RegisteredEngineConfig.RegisterTheoryDataRowFactory
# registration, real xunit.v3.aot.mtp-v2 - and proves xUnit v3's own AOT discovery/execution pipeline
# actually discovers and runs a Compono-composed test under Native AOT. This claim is scoped to
# xUnit v3 (Phase 1's plain [Compose] only) specifically - it says nothing about TUnit/MSTest/NUnit's
# own runners, which remain covered only by the nine aot-smoke legs' narrower guarantee above.
# own runners, which remain covered only by the ten aot-smoke legs' narrower guarantee above.
#
# This repository does not use GitHub merge queues today - no `merge_group` trigger is added
# speculatively; add one later only if that changes.
Expand Down Expand Up @@ -65,13 +65,13 @@ jobs:
echo "Changed files:"
echo "$changed"

all_legs='["Compono","Compono.Http","Compono.Logging","Compono.MSTest","Compono.NUnit","Compono.Options","Compono.TestDoubles","Compono.TUnit","Compono.XunitV3"]'
all_legs='["Compono","Compono.Http","Compono.Logging","Compono.Metrics","Compono.MSTest","Compono.NUnit","Compono.Options","Compono.TestDoubles","Compono.TUnit","Compono.XunitV3"]'

# A change to shared/core/generator infrastructure (or to this workflow itself) can affect
# every packaged leg at once - run all nine rather than reflexively narrowing to only the
# every packaged leg at once - run all ten rather than reflexively narrowing to only the
# paths that happened to change (ADR-0041 Amendment 7's own "do not run it reflexively, but
# do not under-run it either" balance).
# ADR-0066/PLAN-0066: the tenth leg (Compono.XunitV3.Aot's own real-generator, real-xUnit-AOT-
# ADR-0066/PLAN-0066: the eleventh leg (Compono.XunitV3.Aot's own real-generator, real-xUnit-AOT-
# pipeline proof) shares this same core/generator/shared-config trigger, plus its own
# dedicated paths, computed separately below since it runs as its own job
# (aot-xunitv3-aot-pipeline), not part of the aot-smoke matrix - it needs a materially
Expand All @@ -89,7 +89,7 @@ jobs:
fi

if [ "$core_or_shared_change" = "true" ]; then
echo "Core/generator/shared-config change detected - running all nine AotSmokeTest legs."
echo "Core/generator/shared-config change detected - running all ten AotSmokeTest legs."
echo "legs=$all_legs" >> "$GITHUB_OUTPUT"
exit 0
fi
Expand All @@ -101,6 +101,7 @@ jobs:

echo "$changed" | grep -q '^src/Compono\.Http/' && add_leg "Compono.Http"
echo "$changed" | grep -q '^src/Compono\.Logging/' && add_leg "Compono.Logging"
echo "$changed" | grep -q '^src/Compono\.Metrics/' && add_leg "Compono.Metrics"
echo "$changed" | grep -q '^src/Compono\.MSTest/' && add_leg "Compono.MSTest"
echo "$changed" | grep -q '^src/Compono\.NUnit/' && add_leg "Compono.NUnit"
echo "$changed" | grep -q '^src/Compono\.Options/' && add_leg "Compono.Options"
Expand All @@ -110,7 +111,7 @@ jobs:
echo "$changed" | grep -q '^src/Shared/Compono\.XunitV3/' && add_leg "Compono.XunitV3"

# A change scoped to one leg's own AotSmokeTest project only needs that leg re-run, not all
# nine - extract which leg(s) directly from the changed paths.
# ten - extract which leg(s) directly from the changed paths.
for proj in $(echo "$changed" | grep -oE '^test/[^/]+\.AotSmokeTest/' | sed -E 's#^test/(.+)\.AotSmokeTest/#\1#' | sort -u); do
add_leg "$proj"
done
Expand Down Expand Up @@ -161,15 +162,19 @@ jobs:
if: matrix.leg == 'Compono.Logging'
run: bash test/Compono.Logging.AotSmokeTest/verify-packaging.sh

- name: Additional packaging verification (Compono.Metrics)
if: matrix.leg == 'Compono.Metrics'
run: bash test/Compono.Metrics.AotSmokeTest/verify-packaging.sh

- name: Additional analyzer-contract verification (Compono.Http)
if: matrix.leg == 'Compono.Http'
run: bash test/Compono.Http.AotSmokeTest/AnalyzerContract/verify-analyzer-contract.sh

# ADR-0066/PLAN-0066's tenth leg - critically different from the aot-smoke matrix above: this
# ADR-0066/PLAN-0066's eleventh leg - critically different from the aot-smoke matrix above: this
# publishes a REAL Compono.XunitV3.Aot-consuming xUnit v3 test project (real [Theory]+[Compose],
# real Compono.Generators-emitted RegisteredEngineConfig.RegisterTheoryDataRowFactory registration,
# real xunit.v3.aot.mtp-v2), not a hand-dispatch console app - it proves xUnit's own AOT
# discovery/execution pipeline actually runs a Compono-composed test, which none of the nine
# discovery/execution pipeline actually runs a Compono-composed test, which none of the ten
# aot-smoke legs attempt (ADR-0041 Amendment 7's own stated scope boundary).
aot-xunitv3-aot-pipeline:
needs: changes
Expand Down Expand Up @@ -247,8 +252,8 @@ jobs:
exit 1
fi

# Same fail-closed shape for the tenth leg (ADR-0066/PLAN-0066), gated on its own
# xunitv3_aot_applicable output rather than the nine-leg legs array.
# Same fail-closed shape for the eleventh leg (ADR-0066/PLAN-0066), gated on its own
# xunitv3_aot_applicable output rather than the ten-leg legs array.
if [ "$xunitv3_aot_result" = "failure" ] || [ "$xunitv3_aot_result" = "cancelled" ]; then
echo "::error::The Compono.XunitV3.Aot real-pipeline leg failed or was cancelled - see the aot-xunitv3-aot-pipeline job above." >&2
exit 1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
- 'src/Compono.DependencyInjection/**'
- 'src/Compono.Http/**'
- 'src/Compono.Logging/**'
- 'src/Compono.Metrics/**'
- 'src/Compono.MSTest/**'
- 'src/Compono.NUnit/**'
- 'Directory.Build.props'
Expand All @@ -52,6 +53,7 @@ on:
- 'src/Compono.DependencyInjection/**'
- 'src/Compono.Http/**'
- 'src/Compono.Logging/**'
- 'src/Compono.Metrics/**'
- 'src/Compono.MSTest/**'
- 'src/Compono.NUnit/**'
- 'Directory.Build.props'
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
- name: Build publishable packages (net10.0)
run: |
set -euo pipefail
for pkg in Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.MSTest Compono.NUnit; do
for pkg in Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.Metrics Compono.MSTest Compono.NUnit; do
dotnet build "src/${pkg}/${pkg}.csproj" -c Release -f net10.0
done

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
PACK_OUTPUT: ${{ github.workspace }}/artifacts/package-validation
# Single authoritative publishable-package list (PLAN-0061 Phase 1) - the baseline-lookup and
# pack steps below both derive from this one job-level env var instead of each repeating the
# same 11-package literal, so adding/removing a package can't drift across the two
# same 14-package literal, so adding/removing a package can't drift across the two
# independently. A job-level `env:` entry is injected into every step's own
# process environment by GitHub Actions itself, so this survives across the separate `run:`
# steps below (each its own shell process) with no extra plumbing - deliberately not a Bash
# array, which would only live for the one step that declared it.
PACKAGES: "Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.MSTest Compono.NUnit Compono.Options"
PACKAGES: "Compono Compono.XunitV3 Compono.XunitV3.Aot Compono.NSubstitute Compono.Bogus Compono.TUnit Compono.TestDoubles Compono.DependencyInjection Compono.Http Compono.Logging Compono.Metrics Compono.MSTest Compono.NUnit Compono.Options"
steps:
- uses: actions/checkout@v7

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ FodyWeavers.xsd
# 10's Native AOT publish-and-run proof) - regenerated by that script, never committed.
.local-nuget-feed-nunit-aot-smoke/

# Local NuGet feed populated by Compono.Metrics.AotSmokeTest's pack-compono.sh (ADR-0072 / PLAN-0074
# B4's Native AOT publish-and-run proof) - regenerated by that script, never committed.
.local-nuget-feed-metrics-aot-smoke/

# Raw per-run outputs from skills/compono-workspace/ eval iterations - transient, regenerated by
# each run. grading.json/timing.json/benchmark.json/feedback.json ARE committed (this repo's own
# established evaluation-evidence convention, see skills/compono-workspace/benchmarks/), only the
Expand Down
2 changes: 2 additions & 0 deletions Compono.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<Project Path="src/Compono.DependencyInjection/Compono.DependencyInjection.csproj" />
<Project Path="src/Compono.Http/Compono.Http.csproj" />
<Project Path="src/Compono.Logging/Compono.Logging.csproj" />
<Project Path="src/Compono.Metrics/Compono.Metrics.csproj" />
<Project Path="src/Compono.MSTest/Compono.MSTest.csproj" />
<Project Path="src/Compono.NUnit/Compono.NUnit.csproj" />
<Project Path="src/Compono.Options/Compono.Options.csproj" />
Expand All @@ -27,6 +28,7 @@
<Project Path="test/Compono.DependencyInjection.Tests/Compono.DependencyInjection.Tests.csproj" />
<Project Path="test/Compono.Http.Tests/Compono.Http.Tests.csproj" />
<Project Path="test/Compono.Logging.Tests/Compono.Logging.Tests.csproj" />
<Project Path="test/Compono.Metrics.Tests/Compono.Metrics.Tests.csproj" />
<Project Path="test/Compono.MSTest.Tests/Compono.MSTest.Tests.csproj" />
<Project Path="test/Compono.NUnit.Tests/Compono.NUnit.Tests.csproj" />
<Project Path="test/Compono.Options.Tests/Compono.Options.Tests.csproj" />
Expand Down
7 changes: 7 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@
<ItemGroup Label="Microsoft.Extensions.Hosting/Logging test-only (net8.0)" Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<!-- Test-only (net8.0): Compono.Metrics.Tests' Gauge-on-net8.0 regression. A net8.0 compilation
only sees Gauge<T> at compile time if a newer System.Diagnostics.DiagnosticSource is
referenced (the in-box net8.0 shared-framework reference lacks it). Referencing 9.x for the
net8.0 test build reproduces a net8.0 consumer running against DiagnosticSource 9.x, which
proves capture is classified by the base types (Instrument<T>/ObservableInstrument<T>), not
a compile-time #if. Never referenced by any src project. -->
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.0" />
</ItemGroup>
<ItemGroup Label="Microsoft.Extensions.Hosting/Logging test-only (net9.0)" Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.23" />
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Compono determines **how** those requirements are satisfied.
| `Compono.MSTest` | MSTest integration | [![NuGet](https://img.shields.io/nuget/v/Compono.MSTest.svg)](https://www.nuget.org/packages/Compono.MSTest) | [![NuGet Downloads](https://img.shields.io/nuget/dt/Compono.MSTest.svg)](https://www.nuget.org/packages/Compono.MSTest) |
| `Compono.NUnit` | NUnit integration (no `[TestFixture]` required) | [![NuGet](https://img.shields.io/nuget/v/Compono.NUnit.svg)](https://www.nuget.org/packages/Compono.NUnit) | [![NuGet Downloads](https://img.shields.io/nuget/dt/Compono.NUnit.svg)](https://www.nuget.org/packages/Compono.NUnit) |
| `Compono.Options` | `Microsoft.Extensions.Options` testing support (`TestOptionsSource<T>`, `UseOptions<T>()`) | [![NuGet](https://img.shields.io/nuget/v/Compono.Options.svg)](https://www.nuget.org/packages/Compono.Options) | [![NuGet Downloads](https://img.shields.io/nuget/dt/Compono.Options.svg)](https://www.nuget.org/packages/Compono.Options) |
| `Compono.Metrics` | `System.Diagnostics.Metrics` testing support (`UseMetrics()`, `CapturingMeterFactory`, `Verify<T>()`) | [![NuGet](https://img.shields.io/nuget/v/Compono.Metrics.svg)](https://www.nuget.org/packages/Compono.Metrics) | [![NuGet Downloads](https://img.shields.io/nuget/dt/Compono.Metrics.svg)](https://www.nuget.org/packages/Compono.Metrics) |

## Example

Expand Down
Loading
Loading