From a3f92f5411820c5c3ed03c33c845d375fc0ab279 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 10 Apr 2026 13:36:07 -0400 Subject: [PATCH 1/3] Added build and run tests skills dynamo-build-tests (.agents/skills/dynamo-build-tests/SKILL.md) - Workflow: resolve tool paths from memory, build with dotnet build --no-dependencies (preferred), fall back to MSBuild - Documents the --no-dependencies trick that avoids the satellite assembly errors - Lists common test projects and their coverage areas dynamo-run-tests (.agents/skills/dynamo-run-tests/SKILL.md) - Workflow: ensure DLL is current, run with dotnet test --no-build, interpret results - Documents filter syntax, verbosity levels, and troubleshooting (e.g. "discovered 0 of 0") - Links back to build skill for the rebuild step These skills do not overlap with the others. The two new skills cover the operational gap: the concrete flag sequences, the --no-dependencies trick, the known pre-existing errors to ignore, the stale DLL problem, and the tool path lookup pattern. None of the existing skills go anywhere near that. --- .agents/README.md | 8 ++ .agents/skills/dynamo-build-tests/SKILL.md | 90 +++++++++++++++++ .agents/skills/dynamo-run-tests/SKILL.md | 112 +++++++++++++++++++++ AGENTS.md | 2 + 4 files changed, 212 insertions(+) create mode 100644 .agents/skills/dynamo-build-tests/SKILL.md create mode 100644 .agents/skills/dynamo-run-tests/SKILL.md diff --git a/.agents/README.md b/.agents/README.md index fd86c06f7f4..94f1478ad2a 100644 --- a/.agents/README.md +++ b/.agents/README.md @@ -35,6 +35,7 @@ This matrix documents how canonical skills in `.agents/skills/` are exposed in e | Canonical skill | Cursor | Copilot (VS Code/GitHub) | Claude Code | |---|---|---|---| +| `dynamo-build-tests` | Loaded directly from `.agents/skills/dynamo-build-tests/SKILL.md` | — | Loaded directly from `.agents/skills/dynamo-build-tests/SKILL.md` | | `dynamo-codebase-patterns` | Loaded directly from `.agents/skills/dynamo-codebase-patterns/SKILL.md` | Wrapper: `.github/agents/dynamo-codebase-patterns.agent.md` | Loaded directly from `.agents/skills/dynamo-codebase-patterns/SKILL.md` | | `dynamo-content-designer` | Loaded directly from `.agents/skills/dynamo-content-designer/SKILL.md` | Wrapper: `.github/agents/dynamo-content-designer.agent.md` | Loaded directly from `.agents/skills/dynamo-content-designer/SKILL.md` | | `dynamo-dotnet-expert` | Loaded directly from `.agents/skills/dynamo-dotnet-expert/SKILL.md` | Wrapper: `.github/agents/dynamo-dotnet-expert.agent.md` | Loaded directly from `.agents/skills/dynamo-dotnet-expert/SKILL.md` | @@ -42,6 +43,7 @@ This matrix documents how canonical skills in `.agents/skills/` are exposed in e | `dynamo-ecosystem-reviewer` | Loaded directly from `.agents/skills/dynamo-ecosystem-reviewer/SKILL.md` | Wrapper: `.github/agents/dynamo-ecosystem-reviewer.agent.md` | Loaded directly from `.agents/skills/dynamo-ecosystem-reviewer/SKILL.md` | | `dynamo-onboarding` | Loaded directly from `.agents/skills/dynamo-onboarding/SKILL.md` | Wrapper: `.github/agents/dynamo-onboarding.agent.md` | Loaded directly from `.agents/skills/dynamo-onboarding/SKILL.md` | | `dynamo-pr-description` | Loaded directly from `.agents/skills/dynamo-pr-description/SKILL.md` | Wrapper: `.github/agents/dynamo-pr-description.agent.md` | Loaded directly from `.agents/skills/dynamo-pr-description/SKILL.md` | +| `dynamo-run-tests` | Loaded directly from `.agents/skills/dynamo-run-tests/SKILL.md` | — | Loaded directly from `.agents/skills/dynamo-run-tests/SKILL.md` | | `dynamo-jira-ticket` | Loaded directly from `.agents/skills/dynamo-jira-ticket/SKILL.md` | Wrapper: `.github/agents/dynamo-jira-ticket.agent.md` | Loaded directly from `.agents/skills/dynamo-jira-ticket/SKILL.md` | | `dynamo-skill-writer` | Loaded directly from `.agents/skills/dynamo-skill-writer/SKILL.md` | Wrapper: `.github/agents/dynamo-skill-writer.agent.md` | Loaded directly from `.agents/skills/dynamo-skill-writer/SKILL.md` | | `dynamo-unit-testing` | Loaded directly from `.agents/skills/dynamo-unit-testing/SKILL.md` | Wrapper: `.github/agents/dynamo-unit-testing.agent.md` | Loaded directly from `.agents/skills/dynamo-unit-testing/SKILL.md` | @@ -61,6 +63,7 @@ Each skill lives in its own folder with a `SKILL.md` and optionally a `template. | Skill | When to use | Repo scope | |-------|-------------|------------| +| [dynamo-build-tests](skills/dynamo-build-tests/SKILL.md) | Building test projects so DLLs reflect latest source changes. | Repo-specific variant | | [dynamo-codebase-patterns](skills/dynamo-codebase-patterns/SKILL.md) | Discovering and enforcing non-obvious Dynamo structural patterns in scans and reviews. | Repo-specific variant | | [dynamo-content-designer](skills/dynamo-content-designer/SKILL.md) | Writing documentation, tutorials, release notes, and user-facing technical content. | Repo-specific variant | | [dynamo-dotnet-expert](skills/dynamo-dotnet-expert/SKILL.md) | Writing or reviewing C#/.NET code. Code design, testing, performance, PublicAPI management. | Repo-specific variant | @@ -68,6 +71,7 @@ Each skill lives in its own folder with a `SKILL.md` and optionally a `template. | [dynamo-ecosystem-reviewer](skills/dynamo-ecosystem-reviewer/SKILL.md) | Reviewing changes for ecosystem compatibility and cross-repo/platform constraints. | Repo-specific variant | | [dynamo-onboarding](skills/dynamo-onboarding/SKILL.md) | Learning the Dynamo codebase, architecture briefings, finding where to start on a Jira ticket. | Repo-specific variant | | [dynamo-pr-description](skills/dynamo-pr-description/SKILL.md) | Writing PR descriptions matching the Dynamo template. | Repo-specific variant | +| [dynamo-run-tests](skills/dynamo-run-tests/SKILL.md) | Running NUnit tests by name, filter, or project. | Repo-specific variant | | [dynamo-jira-ticket](skills/dynamo-jira-ticket/SKILL.md) | Creating or refining Jira tickets from bugs, test failures, or feature requests. | Repo-specific variant | | [dynamo-skill-writer](skills/dynamo-skill-writer/SKILL.md) | Authoring and updating skills; writing high-quality skill instructions; managing sync across Copilot, Cursor, and Claude surfaces. | Repo-specific variant | | [dynamo-unit-testing](skills/dynamo-unit-testing/SKILL.md) | Writing NUnit tests following Dynamo patterns. Test classes, setup/teardown, .dyn file testing. | Repo-specific variant | @@ -94,6 +98,8 @@ Templates are co-located inside the skill folder that uses them: ``` .agents/ ├── skills/ +│ ├── dynamo-build-tests/ +│ │ └── SKILL.md │ ├── dynamo-codebase-patterns/ │ │ ├── SKILL.md │ │ └── patterns/ @@ -110,6 +116,8 @@ Templates are co-located inside the skill folder that uses them: │ │ └── SKILL.md │ ├── dynamo-pr-description/ │ │ └── SKILL.md +│ ├── dynamo-run-tests/ +│ │ └── SKILL.md │ ├── dynamo-jira-ticket/ │ │ ├── SKILL.md │ │ └── assets/ diff --git a/.agents/skills/dynamo-build-tests/SKILL.md b/.agents/skills/dynamo-build-tests/SKILL.md new file mode 100644 index 00000000000..096e88d711d --- /dev/null +++ b/.agents/skills/dynamo-build-tests/SKILL.md @@ -0,0 +1,90 @@ +--- +name: dynamo-build-tests +description: Build Dynamo test projects so test DLLs reflect the latest source changes. Use this skill when you need to compile test projects before running tests, when dotnet build fails on satellite assembly projects, or when you see "discovered 0 of 0 NUnit test cases" because the DLL is stale. +--- + +# Dynamo Build Tests + +## When to use +- Compiling test projects before running tests +- Rebuilding a specific test DLL after editing test or production code +- Troubleshooting build failures in the test pipeline (e.g. `MSB4803`, missing LibG) + +## When not to use +- Running tests -- use [dynamo-run-tests](../dynamo-run-tests/SKILL.md) instead +- Writing test code -- use [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) instead + +## Inputs expected +The name of the test project or area being tested (e.g. "DynamoCoreWpf3Tests", "DynamoCoreTests"). + +## Output format +Confirmation that the build succeeded with 0 errors in the target project, or a diagnosis of any failures. + +--- + +## Workflow + +### 1. Resolve tool paths + +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: + +```bash +# Find MSBuild via vswhere +"/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" +``` + +Then update the memory file with the new path. + +### 2. Build the test project + +**Preferred: `dotnet build --no-dependencies`** (fast, avoids satellite assembly errors): + +```bash +"/c/Program Files/dotnet/dotnet.exe" build test//.csproj -c Release --no-restore --no-dependencies -v q +``` + +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. + +**If `--no-dependencies` fails** (missing dependency DLLs), build the production project first: + +```bash +"/c/Program Files/dotnet/dotnet.exe" build src//.csproj -c Release --no-restore --no-dependencies -v q +``` + +**If `dotnet build` cannot work at all** (rare), fall back to MSBuild: + +```bash +"/e/VS2026/MSBuild/Current/Bin/MSBuild.exe" "test//.csproj" "-p:Configuration=Release" "-v:q" "-nologo" +``` + +> **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. + +### 3. Verify success + +Check the build output for `0 Error(s)` in the target project. Filter out known pre-existing errors from unrelated projects: +- `MSB4803` from `DynamoUnits` / `DesignScriptBuiltin` (satellite assembly task not supported on .NET Core MSBuild) +- `MSB3030` from `DynamoCore` (missing LibG.Interface.dll — build environment issue) + +These are infrastructure issues, not code errors. + +## Common test projects + +| Test project | What it covers | +|---|---| +| `DynamoCoreTests` | Core engine, graph model, scheduler | +| `DynamoCoreWpfTests` | WPF UI tests (part 1) | +| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) | +| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — includes note pin/unpin, Python customization | +| `ViewExtensionLibraryTests` | View extension tests | +| `VisualizationTests` | Rendering and visualization tests | + +Test DLLs are output to `bin/AnyCPU/Release/.dll`. + +## Boundaries + +- ✅ **Always**: build test and production projects, report errors +- ⚠️ **Ask first**: modify `.csproj` files, change build configuration +- 🚫 **Never**: delete build output folders, modify `Directory.Build.props` + +## Related skills +[dynamo-run-tests](../dynamo-run-tests/SKILL.md) • [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) diff --git a/.agents/skills/dynamo-run-tests/SKILL.md b/.agents/skills/dynamo-run-tests/SKILL.md new file mode 100644 index 00000000000..aa7be414695 --- /dev/null +++ b/.agents/skills/dynamo-run-tests/SKILL.md @@ -0,0 +1,112 @@ +--- +name: dynamo-run-tests +description: Run NUnit tests in the Dynamo repo using dotnet test. Use this skill when executing tests by name, filter, or project — including verifying a fix, running regression suites, or checking specific test results. +--- + +# Dynamo Run Tests + +## When to use +- Running specific tests by name or filter after a code change +- Running all tests in a project to check for regressions +- Verifying that new tests pass +- Debugging test failures (re-running with verbose output) + +## When not to use +- Building test projects -- use [dynamo-build-tests](../dynamo-build-tests/SKILL.md) instead +- Writing test code -- use [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) instead + +## Inputs expected +The test project, and optionally a filter (test name, class name, or category). + +## Output format +Pass/fail summary with counts. For failures: the failing test name, assertion message, and relevant stack trace. + +--- + +## Workflow + +### 1. Ensure the DLL is current + +If you edited test or production code since the last build, rebuild first using [dynamo-build-tests](../dynamo-build-tests/SKILL.md). A stale DLL will either miss new tests ("discovered 0 of 0") or run old code. + +### 2. Run tests + +Use `dotnet test` with `--no-build` to skip recompilation (since you built in step 1): + +```bash +# Run specific test(s) by name substring +"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n + +# Run all tests in a test class +"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n + +# Run all tests in a project +"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build -v n +``` + +> **Important**: Always use `--no-restore --no-build` to avoid triggering the `MSB4803` satellite assembly errors from `DynamoUnits`/`DesignScriptBuiltin`. The DLL must already be built. + +### 3. Interpret results + +**Successful output** ends with: +``` +Test Run Successful. +Total tests: N + Passed: N +``` + +**Failed output** includes assertion details: +``` +Failed TestName [Xs] + Error Message: + Expected: ... + But was: ... +``` + +### Filter syntax + +The `--filter` flag uses `dotnet test` filter expressions: + +| Goal | Filter | +|---|---| +| Test name contains substring | `"FullyQualifiedName~UnpinGroupedNote"` | +| Exact test name | `"FullyQualifiedName=DynamoCoreWpfTests.NoteViewTests.UnpinGroupedNote_NoteRemainsInGroup"` | +| Multiple tests (OR) | `"FullyQualifiedName~TestA\|FullyQualifiedName~TestB"` | +| All tests in a class | `"FullyQualifiedName~NoteViewTests"` | + +### Verbosity levels + +| Flag | Shows | +|---|---| +| `-v q` | Quiet — pass/fail summary only | +| `-v n` | Normal — test names and timing (recommended) | +| `-v d` | Detailed — full output including stdout from tests | + +### Common test projects + +| Test project | What it covers | +|---|---| +| `DynamoCoreTests` | Core engine, graph model, scheduler | +| `DynamoCoreWpfTests` | WPF UI tests (part 1) | +| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) | +| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — note pin/unpin, Python customization | +| `ViewExtensionLibraryTests` | View extension tests | +| `VisualizationTests` | Rendering and visualization tests | + +## Troubleshooting + +| Symptom | Cause | Fix | +|---|---|---| +| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with [dynamo-build-tests](../dynamo-build-tests/SKILL.md) | +| `MSB4803` errors | `--no-build` was omitted or `dotnet test` triggered a rebuild | Add `--no-restore --no-build` flags | +| Test passes but behavior is wrong | Production DLL is stale | Rebuild the production project too | +| `No test matches the given testcase filter` | Filter typo or wrong project | Check spelling; try broader filter like class name | + +## Boundaries + +- ✅ **Always**: run tests, report results, rerun with different verbosity +- ⚠️ **Ask first**: run the entire solution's test suite (can take a long time) +- 🚫 **Never**: add `[Ignore]` or `[Explicit]` to make tests pass; weaken assertions + +## Related skills +[dynamo-build-tests](../dynamo-build-tests/SKILL.md) • [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) diff --git a/AGENTS.md b/AGENTS.md index 73740b9bc5d..2929a028344 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -139,6 +139,7 @@ For each new node, add to `doc/distrib/NodeHelpFiles/`: Read `.agents/` for comprehensive skills, rules, and templates: - **Skills** (task workflows): `.agents/skills//SKILL.md` + - `dynamo-build-tests` -- Build test projects so DLLs reflect latest source changes - `dynamo-codebase-patterns` -- Discover and enforce Dynamo-specific architectural patterns - `dynamo-content-designer` -- Technical content for docs, guides, and release notes - `dynamo-dotnet-expert` -- C#/.NET patterns, testing, PublicAPI @@ -147,6 +148,7 @@ Read `.agents/` for comprehensive skills, rules, and templates: - `dynamo-jira-ticket` -- creating/refining Jira tickets (includes template.md) - `dynamo-onboarding` -- Dynamo architecture, ecosystem, debugging - `dynamo-pr-description` -- PR descriptions matching Dynamo template (uses `.github/PULL_REQUEST_TEMPLATE.md`) + - `dynamo-run-tests` -- Run NUnit tests by name, filter, or project - `dynamo-skill-writer` -- Author and maintain Dynamo agent skills - `dynamo-unit-testing` -- NUnit test writing following Dynamo patterns - `dynamo-ux-designer` -- UX planning and Weave-aligned interface design guidance From f094fea58146f9f52fa6e5a1ee32327d57a84d98 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 10 Apr 2026 13:44:38 -0400 Subject: [PATCH 2/3] Fix CI skill validation: replace cross-skill relative links with plain names The skill validator rejects internal links that escape the skill directory (../other-skill/SKILL.md). Replaced all such links in dynamo-build-tests and dynamo-run-tests with backtick skill name references instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/skills/dynamo-build-tests/SKILL.md | 6 +++--- .agents/skills/dynamo-run-tests/SKILL.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.agents/skills/dynamo-build-tests/SKILL.md b/.agents/skills/dynamo-build-tests/SKILL.md index 096e88d711d..d8127af446e 100644 --- a/.agents/skills/dynamo-build-tests/SKILL.md +++ b/.agents/skills/dynamo-build-tests/SKILL.md @@ -11,8 +11,8 @@ description: Build Dynamo test projects so test DLLs reflect the latest source c - Troubleshooting build failures in the test pipeline (e.g. `MSB4803`, missing LibG) ## When not to use -- Running tests -- use [dynamo-run-tests](../dynamo-run-tests/SKILL.md) instead -- Writing test code -- use [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) instead +- Running tests -- use `dynamo-run-tests` instead +- Writing test code -- use `dynamo-unit-testing` instead ## Inputs expected The name of the test project or area being tested (e.g. "DynamoCoreWpf3Tests", "DynamoCoreTests"). @@ -87,4 +87,4 @@ Test DLLs are output to `bin/AnyCPU/Release/.dll`. - 🚫 **Never**: delete build output folders, modify `Directory.Build.props` ## Related skills -[dynamo-run-tests](../dynamo-run-tests/SKILL.md) • [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) +`dynamo-run-tests` • `dynamo-unit-testing` diff --git a/.agents/skills/dynamo-run-tests/SKILL.md b/.agents/skills/dynamo-run-tests/SKILL.md index aa7be414695..80315eb4685 100644 --- a/.agents/skills/dynamo-run-tests/SKILL.md +++ b/.agents/skills/dynamo-run-tests/SKILL.md @@ -12,8 +12,8 @@ description: Run NUnit tests in the Dynamo repo using dotnet test. Use this skil - Debugging test failures (re-running with verbose output) ## When not to use -- Building test projects -- use [dynamo-build-tests](../dynamo-build-tests/SKILL.md) instead -- Writing test code -- use [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) instead +- Building test projects -- use `dynamo-build-tests` instead +- Writing test code -- use `dynamo-unit-testing` instead ## Inputs expected The test project, and optionally a filter (test name, class name, or category). @@ -27,7 +27,7 @@ Pass/fail summary with counts. For failures: the failing test name, assertion me ### 1. Ensure the DLL is current -If you edited test or production code since the last build, rebuild first using [dynamo-build-tests](../dynamo-build-tests/SKILL.md). A stale DLL will either miss new tests ("discovered 0 of 0") or run old code. +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. ### 2. Run tests @@ -97,7 +97,7 @@ The `--filter` flag uses `dotnet test` filter expressions: | Symptom | Cause | Fix | |---|---|---| -| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with [dynamo-build-tests](../dynamo-build-tests/SKILL.md) | +| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with `dynamo-build-tests` | | `MSB4803` errors | `--no-build` was omitted or `dotnet test` triggered a rebuild | Add `--no-restore --no-build` flags | | Test passes but behavior is wrong | Production DLL is stale | Rebuild the production project too | | `No test matches the given testcase filter` | Filter typo or wrong project | Check spelling; try broader filter like class name | @@ -109,4 +109,4 @@ The `--filter` flag uses `dotnet test` filter expressions: - 🚫 **Never**: add `[Ignore]` or `[Explicit]` to make tests pass; weaken assertions ## Related skills -[dynamo-build-tests](../dynamo-build-tests/SKILL.md) • [dynamo-unit-testing](../dynamo-unit-testing/SKILL.md) +`dynamo-build-tests` • `dynamo-unit-testing` From 3192adaf83e0415e3d539e2b43be32787a25be5b Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 10 Apr 2026 14:05:48 -0400 Subject: [PATCH 3/3] Address Copilot review feedback on dynamo-build-tests and dynamo-run-tests - Remove hardcoded tool paths; use and 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) --- .agents/skills/dynamo-build-tests/SKILL.md | 42 +++++++++--------- .agents/skills/dynamo-run-tests/SKILL.md | 51 +++++++++++++--------- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/.agents/skills/dynamo-build-tests/SKILL.md b/.agents/skills/dynamo-build-tests/SKILL.md index d8127af446e..838270e9220 100644 --- a/.agents/skills/dynamo-build-tests/SKILL.md +++ b/.agents/skills/dynamo-build-tests/SKILL.md @@ -26,39 +26,40 @@ Confirmation that the build succeeded with 0 errors in the target project, or a ### 1. Resolve tool paths -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: +Do not hardcode tool paths. Obtain `` and `` from your environment before running any commands: + +- **Claude Code users**: read `reference_build_tools.md` from the personal memory file (`~/.claude/projects//memory/reference_build_tools.md` — not part of the repo). Update it if a path is stale. +- **All users**: discover MSBuild via `vswhere`: ```bash -# Find MSBuild via vswhere "/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" ``` -Then update the memory file with the new path. +Use the resolved paths as `` and `` in the commands below. ### 2. Build the test project -**Preferred: `dotnet build --no-dependencies`** (fast, avoids satellite assembly errors): +**Preferred: MSBuild** (this repo builds with MSBuild; it handles all project types correctly): ```bash -"/c/Program Files/dotnet/dotnet.exe" build test//.csproj -c Release --no-restore --no-dependencies -v q +"" "test//.csproj" "-p:Configuration=Release" "-v:q" "-nologo" ``` -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. +> **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. -**If `--no-dependencies` fails** (missing dependency DLLs), build the production project first: +**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: ```bash -"/c/Program Files/dotnet/dotnet.exe" build src//.csproj -c Release --no-restore --no-dependencies -v q +"" build test//.csproj -c Release --no-restore --no-dependencies -v q ``` -**If `dotnet build` cannot work at all** (rare), fall back to MSBuild: +**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`: ```bash -"/e/VS2026/MSBuild/Current/Bin/MSBuild.exe" "test//.csproj" "-p:Configuration=Release" "-v:q" "-nologo" +"" build src//.csproj -c Release --no-restore --no-dependencies -v q +"" build test//.csproj -c Release --no-restore --no-dependencies -v q ``` -> **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. - ### 3. Verify success 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 These are infrastructure issues, not code errors. -## Common test projects +## Finding test projects + +Discover available test projects from the repo: + +```bash +find test -name "*.csproj" | sort +``` -| Test project | What it covers | -|---|---| -| `DynamoCoreTests` | Core engine, graph model, scheduler | -| `DynamoCoreWpfTests` | WPF UI tests (part 1) | -| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) | -| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — includes note pin/unpin, Python customization | -| `ViewExtensionLibraryTests` | View extension tests | -| `VisualizationTests` | Rendering and visualization tests | +> **Exception**: The visualization test assembly is `WpfVisualizationTests`, but its directory is `test/VisualizationTests/` — directory and project name differ. All other projects follow the `test//.csproj` pattern. Test DLLs are output to `bin/AnyCPU/Release/.dll`. diff --git a/.agents/skills/dynamo-run-tests/SKILL.md b/.agents/skills/dynamo-run-tests/SKILL.md index 80315eb4685..823fffb1297 100644 --- a/.agents/skills/dynamo-run-tests/SKILL.md +++ b/.agents/skills/dynamo-run-tests/SKILL.md @@ -25,28 +25,45 @@ Pass/fail summary with counts. For failures: the failing test name, assertion me ## Workflow -### 1. Ensure the DLL is current +### 1. Resolve tool path + +Do not hardcode the `dotnet` path. Obtain `` from your environment: + +- **Claude Code users**: read `reference_build_tools.md` from the personal memory file (`~/.claude/projects//memory/reference_build_tools.md` — not part of the repo). +- **All users**: run `where dotnet` (Windows) or `which dotnet` (bash) to locate it. + +### 2. Find the test project + +Discover available test projects: + +```bash +find test -name "*.csproj" | sort +``` + +> **Exception**: The visualization test assembly is `WpfVisualizationTests`, but its directory is `test/VisualizationTests/` — directory and project name differ. All other projects follow the `test//.csproj` pattern. + +### 3. Ensure the DLL is current 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. -### 2. Run tests +### 4. Run tests -Use `dotnet test` with `--no-build` to skip recompilation (since you built in step 1): +Use `dotnet test` with `--no-build` to skip recompilation (since you built in step 3): ```bash # Run specific test(s) by name substring -"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n +"" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n # Run all tests in a test class -"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n +"" test test//.csproj -c Release --no-restore --no-build --filter "FullyQualifiedName~" -v n # Run all tests in a project -"/c/Program Files/dotnet/dotnet.exe" test test//.csproj -c Release --no-restore --no-build -v n +"" test test//.csproj -c Release --no-restore --no-build -v n ``` > **Important**: Always use `--no-restore --no-build` to avoid triggering the `MSB4803` satellite assembly errors from `DynamoUnits`/`DesignScriptBuiltin`. The DLL must already be built. -### 3. Interpret results +### 5. Interpret results **Successful output** ends with: ``` @@ -71,9 +88,14 @@ The `--filter` flag uses `dotnet test` filter expressions: |---|---| | Test name contains substring | `"FullyQualifiedName~UnpinGroupedNote"` | | Exact test name | `"FullyQualifiedName=DynamoCoreWpfTests.NoteViewTests.UnpinGroupedNote_NoteRemainsInGroup"` | -| Multiple tests (OR) | `"FullyQualifiedName~TestA\|FullyQualifiedName~TestB"` | | All tests in a class | `"FullyQualifiedName~NoteViewTests"` | +Multiple tests (OR) — use a literal `|` inside the quoted filter string: + +```bash +--filter "FullyQualifiedName~TestA|FullyQualifiedName~TestB" +``` + ### Verbosity levels | Flag | Shows | @@ -82,22 +104,11 @@ The `--filter` flag uses `dotnet test` filter expressions: | `-v n` | Normal — test names and timing (recommended) | | `-v d` | Detailed — full output including stdout from tests | -### Common test projects - -| Test project | What it covers | -|---|---| -| `DynamoCoreTests` | Core engine, graph model, scheduler | -| `DynamoCoreWpfTests` | WPF UI tests (part 1) | -| `DynamoCoreWpf2Tests` | WPF UI tests (part 2) | -| `DynamoCoreWpf3Tests` | WPF UI tests (part 3) — note pin/unpin, Python customization | -| `ViewExtensionLibraryTests` | View extension tests | -| `VisualizationTests` | Rendering and visualization tests | - ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| -| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with `dynamo-build-tests` | +| "discovered 0 of 0 NUnit test cases" | DLL is stale — new tests not compiled | Rebuild with `dynamo-build-tests` (step 3) | | `MSB4803` errors | `--no-build` was omitted or `dotnet test` triggered a rebuild | Add `--no-restore --no-build` flags | | Test passes but behavior is wrong | Production DLL is stale | Rebuild the production project too | | `No test matches the given testcase filter` | Filter typo or wrong project | Check spelling; try broader filter like class name |