elsa-core/test
Sipke Schoorstra 7ac2da7258
test(auth): check the upgrade guide's mapping table against the catalog (#7989)
* test(auth): check the upgrade guide's mapping table against the catalog

#7982 asked for the guide to be walked against a real deployment before
release notes point at it. Walking it once tells you about one afternoon, so
it is checked on every run instead.

The table tells operators how to rewrite every stored permission, and nothing
verified that what it tells them to write is a permission Elsa accepts. That
gap was not hypothetical: the cutover left several checks comparing against
legacy constants the guide itself instructs you to replace, so following it
silently disabled them. An entry that does not parse, or that names a
resource or verb no module advertises, is a deployment locked out of an
endpoint by doing exactly as it was told.

The published document is read rather than a copy, so this fails when the
guide drifts from the code, which is the direction drift actually goes. Both
checks are guarded against passing vacuously: the parser asserts it found a
plausible number of rows, and the catalog asserts it is not empty.

Building that catalog took three attempts, and the first two under-reported
in ways worth recording. AppDomain.CurrentDomain.GetAssemblies() describes
whatever earlier tests happened to touch: this class saw 29 resources as
missing when run alone and none in a full run, which is an order-dependent
test and worse than no test. Walking GetReferencedAssemblies() from the two
hosts is no better, because the compiler drops references to assemblies whose
types the app never names -- AI, OpenTelemetry and Shells all vanished
despite being project references. Loading every Elsa.*.dll in the output
directory is complete and gives the same answer in isolation as in a full
run, which is the property that matters.

Verified by injecting a malformed entry and an unadvertised one: each check
fails with exactly that entry named, and nothing else.

The table as it stands passes both.

Refs #7982

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(auth): read every mapping row, whatever its indentation

Review found the row filter required an unindented "| `", so a formatting-only
change that indented the table would drop rows silently while the totals still
looked plausible. A skipped row is an unchecked permission, which is the one
outcome this test exists to prevent.

Rows are now matched after trimming, and the left column no longer has to be
backticked. Each data row must yield at least one replacement, so a row that
parses to nothing fails instead of disappearing. Rows saying the permission
was *removed* rather than translated are recognised, and only those: ten of
them exist and none has a replacement to check.

Verified by indenting the whole table and breaking one entry. The old parser
would have read nothing and passed; this reports exactly the broken row.

Refs #7982

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 06:49:47 +02:00
..
component feat(user-tasks): add identity-neutral workflow-bound human tasks (#7955) 2026-08-25 00:09:06 +02:00
integration test(auth): check the upgrade guide's mapping table against the catalog (#7989) 2026-08-25 06:49:47 +02:00
performance Merge release/3.8.0 into main 2026-08-14 11:59:35 +02:00
TlsSmoke [codex] Fix console log metadata and type resolution (#7542) 2026-05-30 22:52:01 +02:00
unit refactor(auth)!: retire the legacy permission constants and duplicate descriptor types (#7987) 2026-08-25 06:04:32 +02:00
Directory.Build.props Upgrade projects to target .NET 10, add conditional System.Linq.Async dependencies for compatibility with earlier frameworks, and update project files for consistency across the solution. (#7062) 2025-11-21 20:55:30 +01:00
Directory.Build.targets [codex] Harden initial security remediation slice (#7495) 2026-05-22 00:45:47 +02:00