fix(deploy): gate Stage v4 rollout on schema-first maintenance and acceptance
This commit is contained in:
1 parent
ac065fa911
commit
795bbb33cf
7 files changed
+179
-43
No files matched your search
@@ -0,0 +1,11 @@
|
||||
const {test}=require('node:test');
|
||||
const assert=require('node:assert/strict');
|
||||
const http=require('node:http');
|
||||
const {accept}=require('../rollout-health.cjs');
|
||||
for(const [name,status,body,pass] of [['bad status',503,'{}',false],['fake html',200,'<html>ok</html>',false],['wrong envelope',200,'{}',false],['valid empty catalog',200,'{"data":[],"meta":{"total":0}}',true]]) {
|
||||
test(name,async()=>{
|
||||
const s=http.createServer((q,r)=>{r.writeHead(status,{'content-type':'application/json'});r.end(body)});
|
||||
await new Promise(r=>s.listen(0,'127.0.0.1',r));
|
||||
try { const p=accept(`http://127.0.0.1:${s.address().port}`); if(pass) await p; else await assert.rejects(p); } finally {await new Promise(r=>s.close(r));}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user