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: 2 additions & 0 deletions TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The test project mirrors the production areas closely.
publishes a trimmed RID-specific CLI and runs whichever entry point the SDK emits (`cdidx.dll` through `dotnet` or the native `cdidx`/`cdidx.exe` apphost). It is reported as skipped on macOS arm64 while SDK/ILLink can crash before exercising `cdidx` (#2586). Do not assume every SDK/runtime pair writes a `cdidx.dll` into self-contained publish output.
- `QueryCommandRunnerTests.RunPublishedTrimmedCli_SearchSupportsCSharpRazorAliases`
uses the same trimmed RID-specific publish path to verify C# Razor language aliases. It is also reported as skipped on macOS arm64 because the SDK/ILLink crash happens before the test reaches `cdidx`.
RID-specific publish helpers must route `NuGetLockFilePath` into the temporary publish output so local test runs do not add runtime sections to source `packages.lock.json` files (#2918).
- `McpServerTests.cs`
MCP JSON-RPC behavior and tool outputs.
- `HttpMcpTransportTests.cs`
Expand Down Expand Up @@ -250,6 +251,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests"
は trimmed な RID 固有 CLI を publish し、SDK が生成した entry point(`dotnet` 経由の `cdidx.dll`、または native の `cdidx`/`cdidx.exe` apphost)を実行します。self-contained publish output に常に `cdidx.dll` が出るとは仮定しないでください。
- `QueryCommandRunnerTests.RunPublishedTrimmedCli_SearchSupportsCSharpRazorAliases`
は同じ trimmed RID 固有 publish 経路で C# Razor の言語 alias を検証します。このテストも macOS arm64 では、`cdidx` に到達する前に SDK/ILLink がクラッシュし得るため skipped として報告されます。
RID 固有 publish helper は `NuGetLockFilePath` を一時 publish 出力へ向け、ローカル test run が source の `packages.lock.json` に runtime section を追加しないようにしてください (#2918)。
- `McpServerTests.cs`
MCP の JSON-RPC 挙動とツール出力のテスト。
- `GitHelperTests.cs`
Expand Down
17 changes: 17 additions & 0 deletions changelog.d/unreleased/2918.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: fixed
issues:
- 2918
affected:
- tests/CodeIndex.Tests/IndexCommandRunnerTests.cs
- tests/CodeIndex.Tests/QueryCommandRunnerTests.cs
- TESTING_GUIDE.md
---

## English

- **Trimmed publish tests no longer dirty the source NuGet lock file on macOS (#2918)** - RID-specific test publishes now write their generated `packages.lock.json` to temporary publish output, so `dotnet test -p:UseSharedCompilation=false` no longer adds `net8.0/osx-arm64` to `src/CodeIndex/packages.lock.json`.

## 日本語

- **trimmed publish テストが macOS で source の NuGet lock file を汚さないようになりました (#2918)** - RID 固有の test publish は生成される `packages.lock.json` を一時 publish 出力へ書くため、`dotnet test -p:UseSharedCompilation=false` が `src/CodeIndex/packages.lock.json` に `net8.0/osx-arm64` を追加しなくなりました。
3 changes: 3 additions & 0 deletions tests/CodeIndex.Tests/IndexCommandRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9028,6 +9028,8 @@ private static string PublishTrimmedCli(string outputDir)
Directory.CreateDirectory(outputDir);
var buildOutputDir = Path.Combine(outputDir, "bin", "publish") + Path.DirectorySeparatorChar;
var intermediateDir = Path.Combine(outputDir, "obj", "publish") + Path.DirectorySeparatorChar;
Directory.CreateDirectory(intermediateDir);
var lockFilePath = Path.Combine(intermediateDir, "packages.lock.json");

var psi = new System.Diagnostics.ProcessStartInfo
{
Expand All @@ -9051,6 +9053,7 @@ private static string PublishTrimmedCli(string outputDir)
psi.ArgumentList.Add("-p:PublishSingleFile=false");
psi.ArgumentList.Add($"-p:OutputPath={buildOutputDir}");
psi.ArgumentList.Add($"-p:IntermediateOutputPath={intermediateDir}");
psi.ArgumentList.Add($"-p:NuGetLockFilePath={lockFilePath}");
psi.ArgumentList.Add("-p:UseSharedCompilation=false");

using var process = System.Diagnostics.Process.Start(psi)
Expand Down
3 changes: 3 additions & 0 deletions tests/CodeIndex.Tests/QueryCommandRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32553,6 +32553,8 @@ private static string PublishTrimmedCli(string outputDir)
Directory.CreateDirectory(outputDir);
var buildOutputDir = Path.Combine(outputDir, "bin", "publish") + Path.DirectorySeparatorChar;
var intermediateDir = Path.Combine(outputDir, "obj", "publish") + Path.DirectorySeparatorChar;
Directory.CreateDirectory(intermediateDir);
var lockFilePath = Path.Combine(intermediateDir, "packages.lock.json");

var psi = new System.Diagnostics.ProcessStartInfo("dotnet")
{
Expand All @@ -32575,6 +32577,7 @@ private static string PublishTrimmedCli(string outputDir)
psi.ArgumentList.Add("-p:PublishSingleFile=false");
psi.ArgumentList.Add($"-p:OutputPath={buildOutputDir}");
psi.ArgumentList.Add($"-p:IntermediateOutputPath={intermediateDir}");
psi.ArgumentList.Add($"-p:NuGetLockFilePath={lockFilePath}");
psi.ArgumentList.Add("-p:UseSharedCompilation=false");

using var process = System.Diagnostics.Process.Start(psi)
Expand Down
Loading