File tree Expand file tree Collapse file tree 2 files changed +46
-25
lines changed Expand file tree Collapse file tree 2 files changed +46
-25
lines changed Original file line number Diff line number Diff line change @@ -8,31 +8,31 @@ import * as path from "std/path/mod.ts";
8
8
9
9
const cwd = path . join ( testDir , "runtimes/wasmedge" ) ;
10
10
11
- // Meta.test(
12
- // {
13
- // name: "WasmEdge runtime: Python SDK",
14
- // port: true,
15
- // systemTypegraphs: true,
16
- // },
17
- // async (t) => {
18
- // await t.should("works on the Python SDK", async () => {
19
- // const engine = await t.engineFromTgDeploy(
20
- // "runtimes/wasmedge/wasmedge.py",
21
- // cwdDir ,
22
- // );
11
+ Meta . test (
12
+ {
13
+ name : "WasmEdge runtime: Python SDK" ,
14
+ port : true ,
15
+ systemTypegraphs : true ,
16
+ } ,
17
+ async ( t ) => {
18
+ await t . should ( "works on the Python SDK" , async ( ) => {
19
+ const engine = await t . engineFromTgDeploy (
20
+ "runtimes/wasmedge/wasmedge.py" ,
21
+ cwd ,
22
+ ) ;
23
23
24
- // await gql`
25
- // query {
26
- // test(a: 1, b: 2)
27
- // }
28
- // `
29
- // .expectData({
30
- // test: 3,
31
- // })
32
- // .on(engine);
33
- // });
34
- // },
35
- // );
24
+ await gql `
25
+ query {
26
+ test(a: 1, b: 2)
27
+ }
28
+ `
29
+ . expectData ( {
30
+ test : 3 ,
31
+ } )
32
+ . on ( engine ) ;
33
+ } ) ;
34
+ } ,
35
+ ) ;
36
36
37
37
Meta . test ( {
38
38
name : "WasmEdge Runtime typescript sdk" ,
Original file line number Diff line number Diff line change @@ -286,7 +286,12 @@ export class MetaTest {
286
286
throw new Error ( "No typegraph" ) ;
287
287
}
288
288
289
- return stdout ;
289
+ const tg_json = extractJsonFromStdout ( stdout ) ;
290
+ if ( ! tg_json ) {
291
+ throw new Error ( "No typegraph" ) ;
292
+ }
293
+
294
+ return tg_json ;
290
295
}
291
296
292
297
async unregister ( engine : QueryEngine ) {
@@ -364,6 +369,22 @@ export class MetaTest {
364
369
}
365
370
}
366
371
372
+ function extractJsonFromStdout ( stdout : string ) : string | null {
373
+ let jsonStart = null ;
374
+ let inJson = false ;
375
+
376
+ for ( const line of stdout . split ( "\n" ) ) {
377
+ if ( inJson ) {
378
+ jsonStart += "\n" + line ;
379
+ } else if ( line . startsWith ( "{" ) ) {
380
+ jsonStart = line ;
381
+ inJson = true ;
382
+ }
383
+ }
384
+
385
+ return jsonStart ;
386
+ }
387
+
367
388
interface TempGitRepo {
368
389
content : Record < string , string > ;
369
390
}
You can’t perform that action at this time.
0 commit comments