You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TESTING_GUIDE.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Use the full suite by default. Use targeted filters only while iterating locally
26
26
- These test-only packages are separate from the production dependency rule in `src/CodeIndex`, which still allows only `Microsoft.Data.Sqlite` at runtime.
27
27
-`FsCheck.Xunit` is reserved for property-based tests that assert universal invariants (never-throws contracts, idempotence, "output is parseable by downstream consumer") across randomly generated inputs. Use it to complement, not replace, the example-based `[Fact]` / `[Theory]` tests — pick FsCheck when the property is a universally quantified claim, and an example test when a specific concrete case is the contract.
28
28
- Test parallelism: enabled by default across independent test classes. Tests that touch process-global state such as SQLite pool resets, environment variables, or current-directory overrides must use an explicit non-parallel collection, and tests that swap `Console.Out` / `Console.Error` must lock on `TestConsoleLock.Gate`.
29
-
- CI runs the test project through `tests/CodeIndex.Tests/CodeIndex.Tests.runsettings`, enables VSTest blame crash and hang collection, applies a 45-minute session timeout plus 60-second xUnit long-running diagnostics, and reruns the suite once after an initial failure. If the retry passes, CI uploads `TestResults/flaky-retry.txt` with the TRX and blame artifacts so the run is treated as suspect instead of silently trusted. XPlat Code Coverage collection is limited to the `ubuntu-latest` / `net8.0` lane so every OS/framework lane still exercises the full suite without paying collector overhead.
29
+
- CI runs the test project through `tests/CodeIndex.Tests/CodeIndex.Tests.runsettings`, enables VSTest blame crash and hang collection, applies a 45-minute session timeout plus 60-second xUnit long-running diagnostics, and reruns the suite once after an initial failure. If the retry passes, CI uploads `TestResults/flaky-retry.txt` with the TRX and blame artifacts so the run is treated as suspect instead of silently trusted. XPlat Code Coverage collection is limited to the `ubuntu-latest` / `net8.0` lane so every OS/framework lane still exercises the full suite without paying collector overhead. Test execution runs with `--no-restore --no-build` after the locked restore and Release build steps. The `ubuntu-latest` / `net8.0` lane also reuses the earlier Release solution build instead of running the per-framework test-project build again, and uses `make lint` as the single formatting verifier.
30
30
31
31
## Test Layout
32
32
@@ -116,11 +116,13 @@ Use the inventory below before adding or moving a test class:
116
116
Prefer the existing helper before writing new setup code.
117
117
118
118
-`CreateTempProject(prefix)` creates a unique temp workspace.
119
+
- Use `CreateTempProject(prefix)` instead of adding local `Path.GetTempPath()` / `Guid.NewGuid()` directory helpers; keep any local wrapper as a thin prefix-specific delegate only when it preserves existing call-site readability.
119
120
-`InitializeGitRepo(projectRoot)` initializes git and sets repo-local `user.name` and `user.email`.
120
121
-`CreateProjectDb(projectRoot)` creates `<projectRoot>/.cdidx/codeindex.db`, initializes schema, and seeds `codeindex_meta.indexed_project_root` to match the project root.
121
122
-`InsertIndexedFile(...)` inserts a realistic indexed file with content-derived checksum, chunks, symbols, and references, and now passes the file path into Python symbol extraction so `__init__.py`-based re-export tests can exercise qualified package names.
122
123
-`RunGit(...)` executes git without shell quoting issues.
123
124
-`DeleteDirectory(path)` retries temp-project cleanup and normalizes attributes. To avoid process-global cross-test interference, it only requests SQLite pool cleanup through `SqlitePoolCleanup` as a Windows-specific retry fallback after a delete failure.
125
+
- Use `DeleteDirectory(path)` in temp-workspace `finally` / `Dispose` cleanup paths, including tests that intentionally remove the workspace earlier in the scenario.
124
126
-`DeleteFile(path)` retries standalone temp-DB cleanup and uses the same Windows-specific SQLite pool release fallback when pooled handles block deletion.
125
127
-`SqlitePoolCleanup` centralizes the Windows SQLite pool workaround for tests. Tests that own a temporary SQLite file for their whole lifetime can enter an exclusive owner lease and dispose it idempotently before deleting the file, instead of calling `SqliteConnection.ClearAllPools()` directly from `Dispose`.
126
128
- Tests that intentionally call `SqliteConnection.ClearAllPools()`, mutate process-global environment variables, or override the process current directory are grouped into the non-parallel `SQLite pool sensitive` xUnit collection. Add new tests with those hazards to that collection instead of letting them run in parallel with unrelated classes.
@@ -238,7 +240,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests"
Copy file name to clipboardExpand all lines: USER_GUIDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1991,6 +1991,7 @@ cdidx helps AI tools by replacing repeated repo-wide scans with a reusable local
1991
1991
-`status --json`, `map --json`, and `inspect --json` expose freshness and git-state signals so an agent can decide whether the index is trustworthy.
1992
1992
-`unused --json` and MCP `unused_symbols` expose bucketed dead-code triage metadata plus graph-support signals, so machine clients can distinguish likely-private cleanup from public/config/reflection suspects and from unsupported-language empty pages.
1993
1993
-`cdidx mcp` gives Claude Code, Cursor, Windsurf, Copilot, and Codex a native MCP server instead of forcing them to scrape shell text.
1994
+
- MCP `tools/list` includes `result._meta` discovery metadata with a first-time AI guide, capability groups, recommended workflows, and the contract that disabled tools are omitted from both `tools` and `_meta`.
1994
1995
1995
1996
For the full MCP tool list, JSON field contracts, exact-match metadata, and fallback behavior on legacy databases, see [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md).
1996
1997
@@ -4551,6 +4552,7 @@ cdidx が AI ワークフローで効く最大の理由は、毎ターン同じ
-**CI test execution skips redundant restore checks** — the Build and Test workflow now runs `dotnet test` with `--no-restore --no-build` after the locked restore and Release build steps.
11
+
12
+
## 日本語
13
+
14
+
-**CI の test execution で重複した restore 確認を省くようにしました** — Build and Test workflow は locked restore と Release build の後、`dotnet test` を `--no-restore --no-build` で実行します。
-**CI skips one redundant test-project build** — the `ubuntu-latest` / `net8.0` test lane now reuses the earlier Release solution build instead of rebuilding the same test project before running tests.
11
+
12
+
## 日本語
13
+
14
+
-**CI の重複した test-project build を 1 回省くようにしました** — `ubuntu-latest` / `net8.0` の test lane は、テスト実行前に同じ test project を再ビルドせず、直前の Release solution build を再利用します。
-**CI removes a duplicate formatting check** — the Build and Test workflow now relies on `make lint` as the single whitespace verifier, and `dev.sh lint` runs without a redundant restore.
-**Reduced C# reference extraction work during full indexing** — files without XML doc comment markers now skip C# XML-doc line-state construction and per-line doc-comment probing.
11
+
12
+
## 日本語
13
+
14
+
-**full index 時の C# reference extraction 作業を削減しました** — XML doc comment marker を含まないファイルでは、C# XML-doc 用 line-state 構築と行ごとの doc-comment 判定を省略するようになりました。
-**C# symbol ranges no longer run away when method bodies write JSON braces** — brace-bodied C# symbols now use raw-source range scanning only when the physical line starts in normal code, so string literal braces inside methods no longer stretch later symbol ranges to the end of large files.
11
+
12
+
## 日本語
13
+
14
+
-**C# symbol range が JSON braces を書き込む method body で過大化しなくなりました** — brace body を持つ C# symbol は物理行の開始状態が通常コードのときだけ raw source で範囲走査するため、method 内の string literal braces で後続 symbol range が巨大ファイル末尾まで伸びなくなりました。
-**Reduced C# symbol extraction allocation during full indexing** — line-comment-only filtering now avoids allocating a trimmed copy for every C# source line.
12
+
13
+
## 日本語
14
+
15
+
-**full index 時の C# symbol extraction allocation を削減しました** — 行コメントだけの行を判定するとき、C# source line ごとの trimmed copy allocation を避けるようになりました。
-**Reduced full-index file loading, masking, and C# reference-shape overhead** — normal UTF-8 source files no longer repeat UTF-16 detection during binary checks or allocate a second whole-file UTF-8 byte array just to compute the canonical checksum; languages that do not need structural line masking no longer clone every line array; and common C# type/attribute shapes avoid LINQ array allocation when compacting whitespace.
0 commit comments