@@ -2,7 +2,7 @@ import assert from "node:assert";
22import { Miniflare , type WorkerOptions } from "miniflare" ;
33import { describe , test } from "vitest" ;
44import { OBSERVABILITY_COLLECTOR_SERVICE_NAME } from "../../../src/plugins/core/constants" ;
5- import { useDispose } from "../../test-shared" ;
5+ import { singleModuleManifest , useDispose } from "../../test-shared" ;
66
77// Local observability wiring.
88//
@@ -16,10 +16,12 @@ import { useDispose } from "../../test-shared";
1616
1717function plainWorker ( script : string ) : WorkerOptions {
1818 return {
19- name : "user" ,
20- modules : true ,
21- compatibilityDate : "2026-06-01" ,
22- script,
19+ config : {
20+ type : "worker" ,
21+ name : "user" ,
22+ compatibilityDate : "2026-06-01" ,
23+ manifest : singleModuleManifest ( script ) ,
24+ } ,
2325 } ;
2426}
2527
@@ -190,19 +192,25 @@ export default {
190192
191193function storeWorker ( ) : WorkerOptions {
192194 return {
193- name : "user" ,
194- modules : true ,
195- compatibilityDate : "2026-06-01" ,
196- script : STORE_HARNESS ,
197- // Bind the collector's internal TraceStore DO (cross-script) to seed it,
198- // and the collector service to read it back through the HTTP read API.
199- durableObjects : {
200- TRACE_STORE : {
201- className : "TraceStore" ,
202- scriptName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
195+ config : {
196+ type : "worker" ,
197+ name : "user" ,
198+ compatibilityDate : "2026-06-01" ,
199+ manifest : singleModuleManifest ( STORE_HARNESS ) ,
200+ // Bind the collector's internal TraceStore DO (cross-script) to seed it,
201+ // and the collector service to read it back through the HTTP read API.
202+ env : {
203+ TRACE_STORE : {
204+ type : "durable-object" ,
205+ workerName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
206+ exportName : "TraceStore" ,
207+ } ,
208+ WOBS : {
209+ type : "worker" ,
210+ workerName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
211+ } ,
203212 } ,
204213 } ,
205- serviceBindings : { WOBS : { name : OBSERVABILITY_COLLECTOR_SERVICE_NAME } } ,
206214 } ;
207215}
208216
@@ -396,12 +404,19 @@ const CAPTURE_WORKER = `export default {
396404
397405function captureWorker ( ) : WorkerOptions {
398406 return {
399- name : "user" ,
400- modules : true ,
401- compatibilityDate : "2026-06-01" ,
402- script : CAPTURE_WORKER ,
403- kvNamespaces : { CACHE : "cache-namespace" } ,
404- serviceBindings : { WOBS : { name : OBSERVABILITY_COLLECTOR_SERVICE_NAME } } ,
407+ config : {
408+ type : "worker" ,
409+ name : "user" ,
410+ compatibilityDate : "2026-06-01" ,
411+ manifest : singleModuleManifest ( CAPTURE_WORKER ) ,
412+ env : {
413+ CACHE : { type : "kv" , id : "cache-namespace" } ,
414+ WOBS : {
415+ type : "worker" ,
416+ workerName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
417+ } ,
418+ } ,
419+ } ,
405420 } ;
406421}
407422
@@ -530,21 +545,30 @@ const UPSTREAM_WORKER = `export default {
530545function multiWorkerSetup ( ) : WorkerOptions [ ] {
531546 return [
532547 {
533- name : "upstream" ,
534- modules : true ,
535- compatibilityDate : "2026-06-01" ,
536- script : UPSTREAM_WORKER ,
537- serviceBindings : {
538- DOWNSTREAM : "downstream" ,
539- WOBS : { name : OBSERVABILITY_COLLECTOR_SERVICE_NAME } ,
548+ config : {
549+ type : "worker" ,
550+ name : "upstream" ,
551+ compatibilityDate : "2026-06-01" ,
552+ manifest : singleModuleManifest ( UPSTREAM_WORKER ) ,
553+ env : {
554+ DOWNSTREAM : { type : "worker" , workerName : "downstream" } ,
555+ WOBS : {
556+ type : "worker" ,
557+ workerName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
558+ } ,
559+ } ,
540560 } ,
541561 } ,
542562 {
543- name : "downstream" ,
544- modules : true ,
545- compatibilityDate : "2026-06-01" ,
546- script : DOWNSTREAM_WORKER ,
547- kvNamespaces : { CACHE : "cache-namespace" } ,
563+ config : {
564+ type : "worker" ,
565+ name : "downstream" ,
566+ compatibilityDate : "2026-06-01" ,
567+ manifest : singleModuleManifest ( DOWNSTREAM_WORKER ) ,
568+ env : {
569+ CACHE : { type : "kv" , id : "cache-namespace" } ,
570+ } ,
571+ } ,
548572 } ,
549573 ] ;
550574}
@@ -586,23 +610,32 @@ export default {
586610 },
587611};` ;
588612
589- describe ( "unsafeObservability (workflows)" , ( ) => {
613+ // NOTE(miniflare v5 options-schema migration): Workflows support is temporarily
614+ // disabled during the config-format migration (the `workflow` binding type is not
615+ // yet in the new schema and the Workflows plugin is a no-op stub). Re-enable this
616+ // test once Workflows is re-implemented against the new config format.
617+ describe . skip ( "unsafeObservability (workflows)" , ( ) => {
590618 test ( "captures the Workflows engine invocation, attributed to the workflow" , async ( {
591619 expect,
592620 } ) => {
593621 const mf = new Miniflare ( {
594622 unsafeObservability : true ,
595- name : "wf-user" ,
596- modules : true ,
597- compatibilityDate : "2026-06-01" ,
598- script : WORKFLOW_CAPTURE_WORKER ,
599- workflows : {
600- CAPTURE_WORKFLOW : {
601- className : "CaptureWorkflow" ,
602- name : "capture-workflow" ,
623+ workers : [
624+ {
625+ config : {
626+ type : "worker" ,
627+ name : "wf-user" ,
628+ compatibilityDate : "2026-06-01" ,
629+ manifest : singleModuleManifest ( WORKFLOW_CAPTURE_WORKER ) ,
630+ env : {
631+ WOBS : {
632+ type : "worker" ,
633+ workerName : OBSERVABILITY_COLLECTOR_SERVICE_NAME ,
634+ } ,
635+ } ,
636+ } ,
603637 } ,
604- } ,
605- serviceBindings : { WOBS : { name : OBSERVABILITY_COLLECTOR_SERVICE_NAME } } ,
638+ ] ,
606639 } ) ;
607640 useDispose ( mf ) ;
608641
0 commit comments