@@ -88,31 +88,34 @@ suite('describe_all metadata upgrade phase 1: install component on first boot',
8888 } ) ;
8989} ) ;
9090
91- suite ( 'describe_all metadata upgrade phase 2: reboot on same data dir, metadata must survive' , ( ctx : ContextWithHarper ) => {
92- before ( async ( ) => {
93- ctx . harper = { dataRootDir : PINNED_DATA_DIR } as any ;
94- await startHarper ( ctx , { config : { threads : { count : 2 } } , env : { } } as any ) ;
95- } ) ;
91+ suite (
92+ 'describe_all metadata upgrade phase 2: reboot on same data dir, metadata must survive' ,
93+ ( ctx : ContextWithHarper ) => {
94+ before ( async ( ) => {
95+ ctx . harper = { dataRootDir : PINNED_DATA_DIR } as any ;
96+ await startHarper ( ctx , { config : { threads : { count : 2 } } , env : { } } as any ) ;
97+ } ) ;
9698
97- after ( async ( ) => {
98- await teardownHarper ( ctx ) ;
99- try {
100- rmSync ( PINNED_DATA_DIR , { recursive : true , force : true } ) ;
101- } catch { }
102- } ) ;
99+ after ( async ( ) => {
100+ await teardownHarper ( ctx ) ;
101+ try {
102+ rmSync ( PINNED_DATA_DIR , { recursive : true , force : true } ) ;
103+ } catch { }
104+ } ) ;
103105
104- test ( 'phase 2 describe_all preserves schema_defined and expiration across reboot' , async ( ) => {
105- const client = createApiClient ( ctx . harper ) ;
106- const body = await describeAll ( client ) ;
107- const pc = body . seo ?. PageCache ?? body . data ?. seo ?. PageCache ;
108- const lm = body . metadata ?. LifecycleMeta ?? body . data ?. metadata ?. LifecycleMeta ;
109- const loose = body . dynamic ?. Loose ?? body . data ?. dynamic ?. Loose ;
110- ok ( pc , 'seo.PageCache must be in describe_all phase 2' ) ;
111- ok ( lm , 'metadata.LifecycleMeta must be in describe_all phase 2' ) ;
112- ok ( loose , 'dynamic.Loose must be in describe_all phase 2' ) ;
113- strictEqual ( pc . schema_defined , true , 'PageCache.schema_defined must remain true after restart' ) ;
114- strictEqual ( pc . expiration , '0s' , 'PageCache.expiration must remain "0s" after restart' ) ;
115- strictEqual ( lm . schema_defined , true , 'LifecycleMeta.schema_defined must remain true after restart' ) ;
116- strictEqual ( loose . schema_defined , false , 'dynamic.Loose.schema_defined must remain false after restart' ) ;
117- } ) ;
118- } ) ;
106+ test ( 'phase 2 describe_all preserves schema_defined and expiration across reboot' , async ( ) => {
107+ const client = createApiClient ( ctx . harper ) ;
108+ const body = await describeAll ( client ) ;
109+ const pc = body . seo ?. PageCache ?? body . data ?. seo ?. PageCache ;
110+ const lm = body . metadata ?. LifecycleMeta ?? body . data ?. metadata ?. LifecycleMeta ;
111+ const loose = body . dynamic ?. Loose ?? body . data ?. dynamic ?. Loose ;
112+ ok ( pc , 'seo.PageCache must be in describe_all phase 2' ) ;
113+ ok ( lm , 'metadata.LifecycleMeta must be in describe_all phase 2' ) ;
114+ ok ( loose , 'dynamic.Loose must be in describe_all phase 2' ) ;
115+ strictEqual ( pc . schema_defined , true , 'PageCache.schema_defined must remain true after restart' ) ;
116+ strictEqual ( pc . expiration , '0s' , 'PageCache.expiration must remain "0s" after restart' ) ;
117+ strictEqual ( lm . schema_defined , true , 'LifecycleMeta.schema_defined must remain true after restart' ) ;
118+ strictEqual ( loose . schema_defined , false , 'dynamic.Loose.schema_defined must remain false after restart' ) ;
119+ } ) ;
120+ }
121+ ) ;
0 commit comments