Skip to content

Commit 910d7ec

Browse files
Merge pull request #41 from purview-dev/cleaning
Cleaning
2 parents a63f9fe + f7ab0d3 commit 910d7ec

805 files changed

Lines changed: 23637 additions & 3551 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This directory is copied into consuming repositories by Purview.DotNetProjectSdk
2+
# so AI agents can discover the bundled skills.
3+
# Keep this file if you want the generated skill content to stay out of source control.
4+
# To disable generation entirely, set <EnableEmbeddedAgentSkills>false</EnableEmbeddedAgentSkills>
5+
# in your project or Directory.Build.props.
6+
*
7+
!.gitignore
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: changesets-prerelease
3+
description: Create and apply a prerelease bump using Changesets CLI, with the new changeset markdown summarizing the actual changes since the last shipped release.
4+
---
5+
6+
# Changesets Prerelease Skill
7+
8+
Use this skill when preparing the next prerelease version in this repository.
9+
10+
## Steps
11+
12+
1. Add a new changeset:
13+
- `npx @changesets/cli add --empty --message "<summary>"`
14+
- update the generated `.changeset/*.md` frontmatter with:
15+
- `"purview-eventsourcing": patch`
16+
- replace the placeholder body with a concise summary of the **actual user-facing changes since the last shipped release**, not just a generic "prepare prerelease" note.
17+
- if the immediately previous prerelease number (for example `.24`) has **not** been released yet and you are preparing `.25`, the new markdown should still describe the cumulative changes that matter for the next published prerelease.
18+
2. Bump versions/changelog:
19+
- `npx @changesets/cli version`
20+
3. Commit the resulting changes (`package.json`, `CHANGELOG.md`, and consumed `.changeset` files).
21+
22+
## Writing the new `.changeset/*.md` body
23+
24+
- Summarize the functional changes that should appear in the changelog for the next published prerelease.
25+
- Prefer short release-note language such as:
26+
- fixed SQL snapshot translation for directly mapped complex mirror properties
27+
- clarified provider documentation for scalar value object query behavior
28+
- aligned repo-local agent skills and instructions
29+
- Do **not** leave the body as a procedural placeholder such as `Prepare next prerelease` unless there were truly no meaningful changes.
30+
- If multiple unreleased prerelease bumps exist locally, write the new file so the generated changelog entry remains useful to an external consumer reading the next shipped release.
31+
32+
## Notes
33+
34+
- Repository currently runs prerelease mode with `tag: prerelease` (`.changeset/pre.json`).
35+
- Releasing is done from `package.json` version in the `release.yml` workflow.
36+
- In prerelease mode, `changeset version` can record a changeset in `.changeset/pre.json` even if the new file was created with placeholder/empty content first. If that happens, correct the `.md` frontmatter/body before finalizing the release notes so the next shipped prerelease entry is accurate.
File renamed without changes.
File renamed without changes.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
name: tunit-test-runner
3+
description: >-
4+
Run, filter, and select TUnit tests through `dotnet test`. Use this whenever
5+
executing .NET tests in a project that depends on TUnit (built on
6+
Microsoft.Testing.Platform / MTP, not VSTest), when `dotnet test --filter`
7+
reports "Zero tests ran", or when tests must be narrowed by assembly,
8+
namespace, class, test name, [Category], or other custom properties. Covers
9+
the `--treenode-filter` path-based query syntax, its operators, the `--`
10+
separator rules across SDK versions, and common 0-tests troubleshooting.
11+
license: MIT
12+
---
13+
14+
# Running TUnit tests with `dotnet test`
15+
16+
## The one rule that matters most
17+
18+
TUnit runs on **Microsoft.Testing.Platform (MTP)**, not VSTest. The reflexive
19+
`dotnet test --filter "Category=X"` **does not work**: MTP silently rejects the
20+
`--filter` flag, prints its own help text, and exits with `Zero tests ran`. That
21+
looks like a passing-but-empty run or a config failure, but it is just an
22+
unrecognised flag. **Never reach for `--filter` on a TUnit project.** Use
23+
`--treenode-filter` instead.
24+
25+
| Other frameworks (VSTest) | TUnit (MTP) |
26+
| ------------------------------------------ | ---------------------------------------------------- |
27+
| `--filter "Category=Integration"` | `--treenode-filter "/*/*/*/*[Category=Integration]"` |
28+
| `--filter "FullyQualifiedName~LoginTests"` | `--treenode-filter "/*/*/LoginTests/*"` |
29+
| `--filter "Name=AcceptCookiesTest"` | `--treenode-filter "/*/*/*/AcceptCookiesTest"` |
30+
31+
## How to invoke it
32+
33+
Prefer `dotnet test` over `dotnet run`: `dotnet test` builds and runs every
34+
targeted TFM automatically and works against a `.csproj`, `.sln`, or `.slnx`,
35+
whereas `dotnet run` only runs a single TFM.
36+
37+
The catch is the `--` separator, which depends on the SDK:
38+
39+
```bash
40+
# Universal form — works on every SDK. Use this by default.
41+
dotnet test -- --treenode-filter "/*/*/LoginTests/*"
42+
43+
# .NET 10+ SDK only — the platform flag can be passed directly.
44+
dotnet test --treenode-filter "/*/*/LoginTests/*"
45+
```
46+
47+
Anything after `--` is passed through to the TUnit test runner rather than to
48+
the `dotnet test` command itself. Flags from extension packages
49+
(`--coverage`, `--report-trx`, `--results-directory`, etc.) **must** also sit
50+
after the `--`:
51+
52+
```bash
53+
dotnet test --configuration Release --no-build \
54+
-- --treenode-filter "/*/*/*/*[Category=Unit]" --coverage --report-trx
55+
```
56+
57+
> Run with no filter to execute everything: `dotnet test`.
58+
59+
## The `--treenode-filter` syntax
60+
61+
A filter is a path with four segments, optionally annotated with a property
62+
group on any segment:
63+
64+
```
65+
/<Assembly>/<Namespace>/<Class>/<TestName>[Property=Value]
66+
```
67+
68+
Use `*` as a wildcard in any segment. The classic "run all tests" filter is
69+
`/*/*/*/*` — four wildcards, one per level.
70+
71+
### Operators
72+
73+
| Operator | Meaning | Example |
74+
| -------- | --------------------------------------------- | -------------------------------------- |
75+
| `*` | Wildcard within a segment | `/*/*/LoginTests*/*` |
76+
| `=` | Property equals (exact) | `/*/*/*/*[Category=Unit]` |
77+
| `!=` | Property not equal (exclude) | `/*/*/*/*[Category!=Slow]` |
78+
| `&` | AND — within one segment / property group | `/**[(Category=Unit)&(Priority=High)]` |
79+
| `\|` | OR — within one segment / property group | `/*/*/(LoginTests)\|(SignupTests)/*` |
80+
| `**` | Match any path depth (must be at the **end**) | `/MyAssembly/**` |
81+
82+
### Two grammar rules that are easy to get wrong
83+
84+
1. **`&` and `|` operate _inside a single segment or property group_, and each
85+
side must be wrapped in parentheses.** They do not join two complete paths.
86+
2. **Only one property group `[...]` is allowed per path segment.** Combine
87+
conditions _inside_ the single bracket — do not chain brackets.
88+
3. **`**` must terminate the path.** `/MyAssembly/**` is valid; `/**/Class/*`
89+
is not.
90+
91+
## Troubleshooting: "Zero tests ran" / 0 tests discovered
92+
93+
Check, in order:
94+
95+
1. **`--filter` was used instead of `--treenode-filter`.** This is the most common cause.
96+
2. **`Microsoft.NET.Test.Sdk` is still referenced.** It conflicts with the TUnit MTP platform.
97+
3. **TUnit package missing.** Ensure `<PackageReference Include="TUnit" Version="*" />`.
98+
4. **Missing `[Test]` attribute** or unsupported method shape.
99+
5. **Wrong `OutputType`.** A `hostfxr.dll could not be found` error means the project needs `<OutputType>Exe</OutputType>`.
100+
6. **Bad filter shape.** Remember the path has exactly four segments.
101+
102+
## References
103+
104+
- TUnit — Test Filters: https://tunit.dev/docs/execution/test-filters/
105+
- TUnit — Troubleshooting & FAQ: https://tunit.dev/docs/troubleshooting/
106+
- TUnit — CI/CD pipelines: https://tunit.dev/docs/examples/tunit-ci-pipeline/
107+
- TUnit — Explicit tests: https://tunit.dev/docs/writing-tests/explicit/
108+
- MTP graph-query filtering spec: https://github.com/microsoft/testfx/blob/main/docs/mstest-runner-graphqueryfiltering/graph-query-filtering.md

‎.changeset/bumpy-crabs-double.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"purview-eventsourcing": patch
3+
---
4+
5+
fixed GetOrCreateAsync always calling creator func/ action

‎.changeset/bumpy-symbols-learn.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"purview-eventsourcing": patch
3+
---
4+
5+
fixed GetOrCreate that called created func regardless of state

‎.changeset/chubby-suns-fry.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"purview-eventsourcing": patch
3+
---
4+
5+
added EF support for complex value objects

‎.changeset/fuzzy-adults-battle.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"purview-eventsourcing": patch
3+
---
4+
5+
fixed the valueobject EF ctor generation not covering all valueobject types

0 commit comments

Comments
 (0)