Skip to content

Commit 3192ada

Browse files
jasonstrattonclaude
andcommitted
Address Copilot review feedback on dynamo-build-tests and dynamo-run-tests
- Remove hardcoded tool paths; use <MSBuildPath> and <DotNetPath> placeholders resolved from memory file or vswhere/where dotnet - Prefer MSBuild over dotnet build (repo standard); dotnet build --no-dependencies is now the fallback - Clarify --no-dependencies failure case: rebuild production project then test project, both with --no-dependencies - Fix VisualizationTests -> WpfVisualizationTests in both skills, with note about directory/project name mismatch - Move OR filter example out of markdown table into a code block to avoid escaped pipe being copied literally - Move "Finding test projects" into the dynamo-run-tests workflow as step 2, before "Ensure the DLL is current" - Fix duplicate step 3 numbering in dynamo-run-tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f094fea commit 3192ada

2 files changed

Lines changed: 52 additions & 41 deletions

File tree

.agents/skills/dynamo-build-tests/SKILL.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,40 @@ Confirmation that the build succeeded with 0 errors in the target project, or a
2626

2727
### 1. Resolve tool paths
2828

29-
Check the `reference_build_tools.md` memory file for cached paths to `msbuild`, `dotnet`, and `vswhere`. If the memory file is missing or the cached path doesn't work, discover the path:
29+
Do not hardcode tool paths. Obtain `<MSBuildPath>` and `<DotNetPath>` from your environment before running any commands:
30+
31+
- **Claude Code users**: read `reference_build_tools.md` from the personal memory file (`~/.claude/projects/<project>/memory/reference_build_tools.md` — not part of the repo). Update it if a path is stale.
32+
- **All users**: discover MSBuild via `vswhere`:
3033

3134
```bash
32-
# Find MSBuild via vswhere
3335
"/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe"
3436
```
3537

36-
Then update the memory file with the new path.
38+
Use the resolved paths as `<MSBuildPath>` and `<DotNetPath>` in the commands below.
3739

3840
### 2. Build the test project
3941

40-
**Preferred: `dotnet build --no-dependencies`** (fast, avoids satellite assembly errors):
42+
**Preferred: MSBuild** (this repo builds with MSBuild; it handles all project types correctly):
4143

4244
```bash
43-
"/c/Program Files/dotnet/dotnet.exe" build test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-dependencies -v q
45+
"<MSBuildPath>" "test/<TestProject>/<TestProject>.csproj" "-p:Configuration=Release" "-v:q" "-nologo"
4446
```
4547

46-
This compiles only the specified project, relying on pre-built dependency DLLs already in the output folder. This avoids the `MSB4803` errors from `DynamoUnits` and `DesignScriptBuiltin` satellite assembly tasks.
48+
> **Important**: When calling MSBuild from bash, quote all flag arguments (e.g. `"-p:Configuration=Release"`) to prevent the shell from interpreting `/p:` as a path.
4749
48-
**If `--no-dependencies` fails** (missing dependency DLLs), build the production project first:
50+
**Fallback: `dotnet build --no-dependencies`** if MSBuild is unavailable. This compiles only the specified project against pre-built dependency DLLs already in the output folder, avoiding `MSB4803` errors from satellite assembly tasks:
4951

5052
```bash
51-
"/c/Program Files/dotnet/dotnet.exe" build src/<ProductionProject>/<ProductionProject>.csproj -c Release --no-restore --no-dependencies -v q
53+
"<DotNetPath>" build test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-dependencies -v q
5254
```
5355

54-
**If `dotnet build` cannot work at all** (rare), fall back to MSBuild:
56+
**If `dotnet build --no-dependencies` fails** because dependency DLLs are missing from the output folder, they need to be built first. Rebuild the production project, then the test project — both with `--no-dependencies`:
5557

5658
```bash
57-
"/e/VS2026/MSBuild/Current/Bin/MSBuild.exe" "test/<TestProject>/<TestProject>.csproj" "-p:Configuration=Release" "-v:q" "-nologo"
59+
"<DotNetPath>" build src/<ProductionProject>/<ProductionProject>.csproj -c Release --no-restore --no-dependencies -v q
60+
"<DotNetPath>" build test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-dependencies -v q
5861
```
5962

60-
> **Important**: When calling MSBuild from bash, quote all flag arguments (e.g. `"-p:Configuration=Release"`) to prevent the shell from interpreting `/p:` as a path.
61-
6263
### 3. Verify success
6364

6465
Check the build output for `0 Error(s)` in the target project. Filter out known pre-existing errors from unrelated projects:
@@ -67,16 +68,15 @@ Check the build output for `0 Error(s)` in the target project. Filter out known
6768

6869
These are infrastructure issues, not code errors.
6970

70-
## Common test projects
71+
## Finding test projects
72+
73+
Discover available test projects from the repo:
74+
75+
```bash
76+
find test -name "*.csproj" | sort
77+
```
7178

72-
| Test project | What it covers |
73-
|---|---|
74-
| `DynamoCoreTests` | Core engine, graph model, scheduler |
75-
| `DynamoCoreWpfTests` | WPF UI tests (part 1) |
76-
| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) |
77-
| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — includes note pin/unpin, Python customization |
78-
| `ViewExtensionLibraryTests` | View extension tests |
79-
| `VisualizationTests` | Rendering and visualization tests |
79+
> **Exception**: The visualization test assembly is `WpfVisualizationTests`, but its directory is `test/VisualizationTests/` — directory and project name differ. All other projects follow the `test/<Name>/<Name>.csproj` pattern.
8080
8181
Test DLLs are output to `bin/AnyCPU/Release/<TestProject>.dll`.
8282

.agents/skills/dynamo-run-tests/SKILL.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,45 @@ Pass/fail summary with counts. For failures: the failing test name, assertion me
2525

2626
## Workflow
2727

28-
### 1. Ensure the DLL is current
28+
### 1. Resolve tool path
29+
30+
Do not hardcode the `dotnet` path. Obtain `<DotNetPath>` from your environment:
31+
32+
- **Claude Code users**: read `reference_build_tools.md` from the personal memory file (`~/.claude/projects/<project>/memory/reference_build_tools.md` — not part of the repo).
33+
- **All users**: run `where dotnet` (Windows) or `which dotnet` (bash) to locate it.
34+
35+
### 2. Find the test project
36+
37+
Discover available test projects:
38+
39+
```bash
40+
find test -name "*.csproj" | sort
41+
```
42+
43+
> **Exception**: The visualization test assembly is `WpfVisualizationTests`, but its directory is `test/VisualizationTests/` — directory and project name differ. All other projects follow the `test/<Name>/<Name>.csproj` pattern.
44+
45+
### 3. Ensure the DLL is current
2946

3047
If you edited test or production code since the last build, rebuild first using `dynamo-build-tests`. A stale DLL will either miss new tests ("discovered 0 of 0") or run old code.
3148

32-
### 2. Run tests
49+
### 4. Run tests
3350

34-
Use `dotnet test` with `--no-build` to skip recompilation (since you built in step 1):
51+
Use `dotnet test` with `--no-build` to skip recompilation (since you built in step 3):
3552

3653
```bash
3754
# Run specific test(s) by name substring
38-
"/c/Program Files/dotnet/dotnet.exe" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~<TestNameSubstring>" -v n
55+
"<DotNetPath>" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~<TestNameSubstring>" -v n
3956

4057
# Run all tests in a test class
41-
"/c/Program Files/dotnet/dotnet.exe" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~<ClassName>" -v n
58+
"<DotNetPath>" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~<ClassName>" -v n
4259

4360
# Run all tests in a project
44-
"/c/Program Files/dotnet/dotnet.exe" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build -v n
61+
"<DotNetPath>" test test/<TestProject>/<TestProject>.csproj -c Release --no-restore --no-build -v n
4562
```
4663

4764
> **Important**: Always use `--no-restore --no-build` to avoid triggering the `MSB4803` satellite assembly errors from `DynamoUnits`/`DesignScriptBuiltin`. The DLL must already be built.
4865
49-
### 3. Interpret results
66+
### 5. Interpret results
5067

5168
**Successful output** ends with:
5269
```
@@ -71,9 +88,14 @@ The `--filter` flag uses `dotnet test` filter expressions:
7188
|---|---|
7289
| Test name contains substring | `"FullyQualifiedName~UnpinGroupedNote"` |
7390
| Exact test name | `"FullyQualifiedName=DynamoCoreWpfTests.NoteViewTests.UnpinGroupedNote_NoteRemainsInGroup"` |
74-
| Multiple tests (OR) | `"FullyQualifiedName~TestA\|FullyQualifiedName~TestB"` |
7591
| All tests in a class | `"FullyQualifiedName~NoteViewTests"` |
7692

93+
Multiple tests (OR) — use a literal `|` inside the quoted filter string:
94+
95+
```bash
96+
--filter "FullyQualifiedName~TestA|FullyQualifiedName~TestB"
97+
```
98+
7799
### Verbosity levels
78100

79101
| Flag | Shows |
@@ -82,22 +104,11 @@ The `--filter` flag uses `dotnet test` filter expressions:
82104
| `-v n` | Normal — test names and timing (recommended) |
83105
| `-v d` | Detailed — full output including stdout from tests |
84106

85-
### Common test projects
86-
87-
| Test project | What it covers |
88-
|---|---|
89-
| `DynamoCoreTests` | Core engine, graph model, scheduler |
90-
| `DynamoCoreWpfTests` | WPF UI tests (part 1) |
91-
| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) |
92-
| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — note pin/unpin, Python customization |
93-
| `ViewExtensionLibraryTests` | View extension tests |
94-
| `VisualizationTests` | Rendering and visualization tests |
95-
96107
## Troubleshooting
97108

98109
| Symptom | Cause | Fix |
99110
|---|---|---|
100-
| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with `dynamo-build-tests` |
111+
| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with `dynamo-build-tests` (step 3) |
101112
| `MSB4803` errors | `--no-build` was omitted or `dotnet test` triggered a rebuild | Add `--no-restore --no-build` flags |
102113
| Test passes but behavior is wrong | Production DLL is stale | Rebuild the production project too |
103114
| `No test matches the given testcase filter` | Filter typo or wrong project | Check spelling; try broader filter like class name |

0 commit comments

Comments
 (0)