Title: Adapt to the @rstest/core 1.0 reporter contract: status literals, payload fields, onTestRunStart payload · Issue #115 · rstackjs/rstack-editor · GitHub
Open Graph Title: Adapt to the @rstest/core 1.0 reporter contract: status literals, payload fields, onTestRunStart payload · Issue #115 · rstackjs/rstack-editor
X Title: Adapt to the @rstest/core 1.0 reporter contract: status literals, payload fields, onTestRunStart payload · Issue #115 · rstackjs/rstack-editor
Description: Background web-infra-dev/rstest#1875 (draft, feat/reporter-contract) stabilizes the reporter contract for @rstest/core 1.0. It is a deliberate pre-1.0 break, and this extension resolves @rstest/core from the user's project, so a project ...
Open Graph Description: Background web-infra-dev/rstest#1875 (draft, feat/reporter-contract) stabilizes the reporter contract for @rstest/core 1.0. It is a deliberate pre-1.0 break, and this extension resolves @rstest/cor...
X Description: Background web-infra-dev/rstest#1875 (draft, feat/reporter-contract) stabilizes the reporter contract for @rstest/core 1.0. It is a deliberate pre-1.0 break, and this extension resolves @rstest/cor...
Opengraph URL: https://github.com/rstackjs/rstack-editor/issues/115
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Adapt to the @rstest/core 1.0 reporter contract: status literals, payload fields, onTestRunStart payload","articleBody":"## Background\n\n`web-infra-dev/rstest#1875` (draft, `feat/reporter-contract`) stabilizes the reporter contract for `@rstest/core` 1.0. It is a deliberate pre-1.0 break, and this extension resolves `@rstest/core` from the user's project, so a project that upgrades to core 1.0 while the extension stays on today's code degrades **silently**: `SUPPORT_MATRIX['@rstest/core'] = '>=0.12.0'` is satisfied by `1.0.0`, no version-mismatch status fires, and the status `switch`es below simply stop matching.\n\nFiled from the rstest PR side, per its AGENTS rule that a change touching this API surface must be linked in both repos in the same PR cycle.\n\n## Upstream changes (verified against `feat/reporter-contract` @ `dd061a1d`)\n\n- `TestResultStatus`: `pass | fail | skip | todo` → `passed | failed | skipped | todo`.\n- API `TestRunResult['status']` (now the shared `TestRunStatus`): `pass | fail | error` → `passed | failed | error`. The value is computed by the host and carried on `TestRunEndPayload`; `api/result.ts` no longer derives it.\n- All reporter hooks return `MaybePromise\u003cvoid>`; events fire in arrival order and the host joins pending hooks before `onTestFileResult` (per file) and `onTestRunEnd` (whole run).\n- `onTestRunStart(payload)` now receives `{ files: { testPath, project, testId }[] }`. Implementations that take no argument stay assignable.\n- Required payload additions: `TestCaseInfo` / `TestSuiteInfo` / `TestResult` gain `fullName` and `relativeTestPath`; `TestFileInfo` gains `relativeTestPath`; `TestFileResult` gains `relativeTestPath` and a required `summary` (`TestRunSummary.tests` also gains `flaky`).\n- `parseErrorStacktrace` in `packages/core/src/utils/error.ts` changed: `stackIgnores` is now `RegExp[]` (`/(^|\\/)node:/`, `/\u003canonymous>/`), `file://` paths are unwrapped, sourcemapped frames keep the mapped `methodName`, and the post-sourcemap filter now always runs (a custom ignore list no longer disables it).\n- CLI flags are unchanged; the blob format version is bumped (the editor does not use the blob reporter or `merge-reports` — verified).\n- The main `@rstest/core` entry re-exports the new public types (`TestRunStatus`, `TestRunStartPayload`, `TestRunEndPayload`, `TestRunSummary`, `Duration`, `MaybePromise`, …).\n\n## Impact in this repo\n\n1. Status switches silently no-op against 1.0:\n - `packages/vscode/src/stacks/test/testRunReporter.ts` — `onTestFileResult` and `onTestCaseResult` switch on `pass` / `fail` / `skip`. With 1.0 values no case matches, so file and case items are never marked passed/failed/skipped and errors never reach the run.\n - `packages/vscode/src/stacks/test/worker/index.ts` — `result.status === 'fail'` guard for \"failed without test-level failures\" stops firing, so an operation-level failure (coverage threshold, report error) can be swallowed.\n2. Old literals in unit tests: `packages/vscode/tests/stacks/test/master.test.ts` fake `run()` results (`'pass'` / `'fail'`, several sites) and the `0.12.0` default in its `writeCoreInstall` helper; `packages/vscode/tests/versionCheck.test.ts` pins the matrix strings.\n3. Vendored core internals need a re-sync: `packages/vscode/src/stacks/test/vendored/coreInternals.ts`. Its header says the stack-frame filtering is kept byte-identical because it decides the editor's failure location, so the 1.0 `error.ts` changes belong in the next sync. (The editor calls `parseErrorStacktrace({ stack })` without `getSourcemap`; the `file://` unwrap, the regex set and the unconditional post-filter still apply.)\n4. Support matrix / dependency wiring:\n - `packages/vscode/src/shared/versionCheck.ts`: `SUPPORT_MATRIX['@rstest/core'] = '>=0.12.0'`. Semver-wise 1.0 passes, so nothing gates the break.\n - `packages/vscode/package.json` devDependency `@rstest/core: ^0.12.4`; the E2E fixture roots pin `0.12.4` in four `package.json` files under `packages/vscode/e2e/`.\n - `packages/vscode/AGENTS.md` → `stacks/test` \"Tracked upstream state\" points at rstest `packages/vscode` `e1607861`; that reference should move to the commit that ships 1.0 support.\n - If the floor is raised, `SUPPORT_MATRIX.rstack = '>=0.7.6'` moves with it: its rationale is \"the first rstack release pinning `@rstest/core ~0.12.0`\", so the new floor needs the first rstack release pinning 1.0 (cross-repo, rstack-cli).\n\n## Compatibility decision needed\n\n- **A. Keep `>=0.12.0` and normalize at the boundary.** Map legacy literals (`pass`/`fail`/`skip` → `passed`/`failed`/`skipped`) in one reporter-side normalizer; 1.0 is otherwise additive (new required fields, new hooks signature, new run-start payload), so the rest is forward-compatible. Bump the devDependency to 1.x to compile against the real types, and keep the normalizer total for unknown values so a future literal change cannot silently half-work. 0.12 projects keep working after the extension auto-updates; no rstack-cli release needed for the floor.\n- **B. Raise the floor to `>=1.0.0`.** Update the matrix, its tests, the devDependency, the fixtures and the rstack floor (needs an rstack release pinning 1.0). Cleaner, but projects still on 0.12 get an unsupported-version status, and the frozen standalone extension (`^0.12.0` only, see #75) is no longer a fallback.\n\nRecommendation: **A**. The extension updates itself, `@rstest/core` is project-resolved, and 0.12 projects will exist for a long time after 1.0 lands.\n\n## Proposed work (option A)\n\n1. Add one normalizer (e.g. `stacks/test/shared/status.ts` or beside `TestRunReporter`) for test-result and run-result statuses; use it in both reporter switches and in the worker's `run()`-result guard.\n2. Bump `@rstest/core` devDependency to the 1.0 line once published so type-checking sees the real literals; before that, test against a local build via `rstack.rstest.corePath`.\n3. Re-sync `vendored/coreInternals.ts` against the 1.0 `error.ts`.\n4. Update unit tests and fakes to the new literals and required payload fields, keeping legacy literals covered through the normalizer.\n5. Bump E2E fixture pins; point at least one fixture at a 1.0 core so both lines are exercised (or widen the Renovate range and rely on the `rstack toolchain` group).\n6. Update the `AGENTS.md` tracked-upstream note and the support-matrix comments/tests.\n7. Verify: `pnpm lint && pnpm test:unit`, then `pnpm test:e2e:rstest`. `rstackjs/rstack-ecosystem-ci#99` builds `@rstest/core` from rstest `main` and runs this repo's `test:unit` + `lint`, so opening the adaptation PR in the same cycle as #1875 gives the cross-repo signal before the release.\n\n## Out of scope (checked)\n\n- Blob reporter / `merge-reports` format: not used here.\n- `reporters` accepting module specifiers: the editor passes reporter instances, unaffected.\n- `listTests()`: unchanged for callers (the collector's raw types changed internally).\n\n## References\n\n- rstest PR: https://github.com/web-infra-dev/rstest/pull/1875\n- rstest tracker: web-infra-dev/rstest#1294 (items 21–23)\n- Precedent: #40 (toolchain drift), #75 (frozen standalone extension supports `^0.12.0` only)\n","author":{"url":"https://github.com/fi3ework","@type":"Person","name":"fi3ework"},"datePublished":"2026-10-27T06:46:49Z","url":"https://github.com/rstackjs/rstack-editor/issues/115"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:34f4cd34-d58a-271d-2d8e-7166805451fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAEE:1F56F4:222E91:2FE055:6AECF5B8 |
| html-safe-nonce | a7dd885ad53ffe23c3e3abe201ea1136b41c68cb5d1226d292d855f586e0f281 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUVFOjFGNTZGNDoyMjJFOTE6MkZFMDU1OjZBRUNGNUI4IiwidmlzaXRvcl9pZCI6IjMxMTU4MzIyODkyMjQ2MTk0NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6092753e6708f57a3241d20aa7e7e6452242c1377ed095c97a75d1370a59c316 |
| hovercard-subject-tag | issue:6054346158 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rstackjs/rstack-editor/115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b430e11d9fe9a34d45ae50fa42346edb88811f44f3b0cbae271e1580dd450c50/rstackjs/rstack-editor/issues/115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b430e11d9fe9a34d45ae50fa42346edb88811f44f3b0cbae271e1580dd450c50/rstackjs/rstack-editor/issues/115 |
| og:image:alt | Background web-infra-dev/rstest#1875 (draft, feat/reporter-contract) stabilizes the reporter contract for @rstest/core 1.0. It is a deliberate pre-1.0 break, and this extension resolves @rstest/cor... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fi3ework |
| hostname | github.com |
| expected-hostname | github.com |
| None | 80acd59cd7735dad62df7be8125e1689bc132c07bc46e7498af0fcc391b80b4f |
| turbo-cache-control | no-preview |
| go-import | github.com/rstackjs/rstack-editor git https://github.com/rstackjs/rstack-editor.git |
| octolytics-dimension-user_id | 129049372 |
| octolytics-dimension-user_login | rstackjs |
| octolytics-dimension-repository_id | 1316963958 |
| octolytics-dimension-repository_nwo | rstackjs/rstack-editor |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1316963958 |
| octolytics-dimension-repository_network_root_nwo | rstackjs/rstack-editor |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 711407b7c0a9167a19a52f516c0bf848416bbd1f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width