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
packages/typespec-tsunit-modular scenario snapshots are stale on main, causing the typespec-ts / CI → Run unit tests job to fail for any PR that touches packages/typespec-ts/** (the pull_request build merges main, so the stale snapshots are exercised against the current ARM library).
Root cause: #4494 ("Improve documentation for ARM library decorators, interfaces, and models") changed the ARM operation templates in packages/typespec-azure-resource-manager/lib/*.tsp — the human-facing operation docs (e.g. A long-running resource action.) were moved to @dev and the public doc set to @doc(""). As a result ARM LRO operations now emit no public doc comment. The checked-in typespec-ts modular-unit scenario snapshots still expect the old doc text, so the generated output no longer matches.
Because #4494 did not touch packages/typespec-ts/**, ci-typescript.yml never ran on it, so the snapshot drift landed on main unnoticed. The merge_group runs for pr-4494 and pr-4547 show the same failure on the queue.
Example diffs from the failing job:
- /** A long-running resource action. */ export function backup(
+ export function backup(
- /** * This sample demonstrates how to a long-running resource action. * * @summary a long-running resource action. ...
+ /** * This sample demonstrates how to * * @summary * ...
Affected scenarios include (at least) the ARM samples/operations that use ArmResourceActionAsync-style templates, e.g. test/modular-unit/scenarios/samples/parameters/bodyOptionalParameterName.md and test/modular-unit/scenarios/operations/lroPaging.md.
Suggested fix: regenerate the affected modular-unit snapshots against current main by running the unit tests with the update flag, then commit the updated .md scenario files:
cd packages/typespec-ts
SCENARIOS_UPDATE=true pnpm unit-test
Broader follow-up to consider: ARM library (typespec-azure-resource-manager) changes can alter typespec-ts emitted output but do not currently trigger ci-typescript.yml, so this class of drift can recur. Consider widening the ci-typescript.ymlpaths triggers to include the emitter's TypeSpec library dependencies (e.g. typespec-azure-resource-manager, typespec-client-generator-core) and/or reconsidering which suites run in the repo-wide vitest run.
Context: found while working on #4788 (enabling typespec-ts unit tests in the repo-wide run). That PR is currently red solely due to this pre-existing drift, not its own changes.
Reproduction
Not a spec/playground bug — this is a repo CI / snapshot drift issue reproducible in the repo itself:
pnpm install and build typespec-ts and its dependencies.
cd packages/typespec-ts && pnpm unit-test.
Observe AssertionError snapshot mismatches for ARM LRO operations/samples where the expected output contains doc comments (e.g. A long-running resource action.) that the current ARM library no longer emits.
Checklist
Follow our Code of Conduct
Check that this issue is about the Azure libraries for typespec
Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
The provided reproduction is a minimal reproducible example of the bug.
Describe the bug
packages/typespec-tsunit-modularscenario snapshots are stale onmain, causing the typespec-ts / CI → Run unit tests job to fail for any PR that touchespackages/typespec-ts/**(thepull_requestbuild mergesmain, so the stale snapshots are exercised against the current ARM library).Root cause: #4494 ("Improve documentation for ARM library decorators, interfaces, and models") changed the ARM operation templates in
packages/typespec-azure-resource-manager/lib/*.tsp— the human-facing operation docs (e.g.A long-running resource action.) were moved to@devand the public doc set to@doc(""). As a result ARM LRO operations now emit no public doc comment. The checked-in typespec-tsmodular-unitscenario snapshots still expect the old doc text, so the generated output no longer matches.Because #4494 did not touch
packages/typespec-ts/**,ci-typescript.ymlnever ran on it, so the snapshot drift landed onmainunnoticed. Themerge_groupruns for pr-4494 and pr-4547 show the same failure on the queue.Example diffs from the failing job:
Affected scenarios include (at least) the ARM samples/operations that use
ArmResourceActionAsync-style templates, e.g.test/modular-unit/scenarios/samples/parameters/bodyOptionalParameterName.mdandtest/modular-unit/scenarios/operations/lroPaging.md.Suggested fix: regenerate the affected
modular-unitsnapshots against currentmainby running the unit tests with the update flag, then commit the updated.mdscenario files:Broader follow-up to consider: ARM library (
typespec-azure-resource-manager) changes can alter typespec-ts emitted output but do not currently triggerci-typescript.yml, so this class of drift can recur. Consider widening theci-typescript.ymlpathstriggers to include the emitter's TypeSpec library dependencies (e.g.typespec-azure-resource-manager,typespec-client-generator-core) and/or reconsidering which suites run in the repo-wide vitest run.Context: found while working on #4788 (enabling typespec-ts unit tests in the repo-wide run). That PR is currently red solely due to this pre-existing drift, not its own changes.
Reproduction
Not a spec/playground bug — this is a repo CI / snapshot drift issue reproducible in the repo itself:
main(which includes Improve documentation for ARM library decorators, interfaces, and models #4494).pnpm installand build typespec-ts and its dependencies.cd packages/typespec-ts && pnpm unit-test.AssertionErrorsnapshot mismatches for ARM LRO operations/samples where the expected output contains doc comments (e.g.A long-running resource action.) that the current ARM library no longer emits.Checklist