From 714e61166f31e69d5aa27eefea4ad13dcda8fb3f Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Wed, 29 Mar 2023 11:07:14 -0400 Subject: [PATCH 01/17] feat: trun workflows --- .github/workflows/examples-browser.yml | 18 ++++++++ .github/workflows/examples-deno.yml | 18 ++++++++ _tasks/test_examples.ts | 59 -------------------------- 3 files changed, 36 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/examples-browser.yml create mode 100644 .github/workflows/examples-deno.yml delete mode 100644 _tasks/test_examples.ts diff --git a/.github/workflows/examples-browser.yml b/.github/workflows/examples-browser.yml new file mode 100644 index 000000000..f87bb5167 --- /dev/null +++ b/.github/workflows/examples-browser.yml @@ -0,0 +1,18 @@ +name: Examples (Browser) + +on: + pull_request: + merge_group: + push: + branches: + - main + +jobs: + run-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + container: + image: ghcr.io/paritytech/trun:main + steps: + - uses: actions/checkout@v3 + - run: deno task capi -- deno run -A -r=http://localhost:4646/ /trun/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser diff --git a/.github/workflows/examples-deno.yml b/.github/workflows/examples-deno.yml new file mode 100644 index 000000000..e9c4e0e8b --- /dev/null +++ b/.github/workflows/examples-deno.yml @@ -0,0 +1,18 @@ +name: Examples (Deno) + +on: + pull_request: + merge_group: + push: + branches: + - main + +jobs: + run-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + container: + image: ghcr.io/paritytech/trun:main + steps: + - uses: actions/checkout@v3 + - run: deno task capi -- deno run -A -r=http://localhost:4646/ /trun/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ diff --git a/_tasks/test_examples.ts b/_tasks/test_examples.ts deleted file mode 100644 index 43d8acee0..000000000 --- a/_tasks/test_examples.ts +++ /dev/null @@ -1,59 +0,0 @@ -// TODO: rename this task - -import { parse } from "../deps/std/flags.ts" -import { Buffer, readLines } from "../deps/std/io.ts" -import * as path from "../deps/std/path.ts" -import { readerFromStreamReader, writeAll } from "../deps/std/streams.ts" -import { assert } from "../deps/std/testing/asserts.ts" - -const { dir } = parse(Deno.args, { - string: ["dir"], - default: { - dir: "examples", - }, -}) - -const ignoreFile = await Deno.readTextFile(path.join(dir, ".ignore")) -const ignoredFiles = new Set(ignoreFile.split("\n")) - -const exampleFileNames = Array.from(Deno.readDirSync(dir)) - .filter((e) => e.name.match(/^.*\.ts$/g) && e.isFile && !ignoredFiles.has(e.name)) - .map((f) => f.name) - -Deno.test("examples", async (t) => { - await Promise.all(exampleFileNames.map((name) => { - return t.step({ - name: name, - async fn() { - const command = new Deno.Command(Deno.execPath(), { - args: ["run", "-A", "-r=http://localhost:4646/", `${dir}/${name}`], - stdout: "piped", - stderr: "piped", - }) - const task = command.spawn() - const out = new Buffer() - await Promise.all([ - pipeThrough(readerFromStreamReader(task.stdout.getReader()), out), - pipeThrough(readerFromStreamReader(task.stderr.getReader()), out), - ]) - const status = await task.status - if (!status.success) { - for await (const line of readLines(out)) { - console.log(line) - } - } - assert(status.success, `task failed with status code: ${status.code}`) - }, - sanitizeExit: false, - sanitizeOps: false, - sanitizeResources: false, - }) - })) -}) - -async function pipeThrough(reader: Deno.Reader, writer: Deno.Writer) { - const encoder = new TextEncoder() - for await (const line of readLines(reader)) { - await writeAll(writer, encoder.encode(`${line}\n`)) - } -} From 155128cd19ee831b978856b5cd08b5436c3b1d9b Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 30 Mar 2023 09:57:47 -0400 Subject: [PATCH 02/17] rebase cbb --- deps/capi_binary_builds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/capi_binary_builds.ts b/deps/capi_binary_builds.ts index 3ae235f84..76308a46f 100644 --- a/deps/capi_binary_builds.ts +++ b/deps/capi_binary_builds.ts @@ -1 +1 @@ -export * from "https://raw.githubusercontent.com/paritytech/capi-binary-builds/ee456af/download.ts" +export * from "https://raw.githubusercontent.com/paritytech/capi-binary-builds/28444f4/download.ts" From 6d1aa56f901446c645a93a0588cbba517314d751 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 30 Mar 2023 13:43:02 -0400 Subject: [PATCH 03/17] address comments --- .github/workflows/checks.yml | 33 ++++++++++++++++++++++++++ .github/workflows/examples-browser.yml | 18 -------------- .github/workflows/examples-deno.yml | 18 -------------- deno.jsonc | 3 ++- words.txt | 1 + 5 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/examples-browser.yml delete mode 100644 .github/workflows/examples-deno.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4cde94dbe..b05ead24d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -84,3 +84,36 @@ jobs: target/capi/**/_chainName key: ${{ runner.os }}-capi-metadata-${{ hashFiles('import_map.json') }} - run: deno task test + test-examples-deno: + name: Test Examples (Deno) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 # v1.1.0 + with: + deno-version: v1.x + - name: Cache Deno dependencies + uses: actions/cache@v3 + with: + path: | + ~/.deno + ~/.cache/deno + key: ${{ runner.os }}-deno-${{ hashFiles('deps/**/*.ts') }} + - name: Cache metadata + uses: actions/cache@v3 + with: + path: | + target/capi/**/_metadata + target/capi/**/_chainName + key: ${{ runner.os }}-capi-metadata-${{ hashFiles('import_map.json') }} + - run: deno task test:examples:deno + test-examples-browser: + name: Test Examples (Browser) + runs-on: ubuntu-latest + timeout-minutes: 15 + container: + image: ghcr.io/paritytech/trun:main + steps: + - uses: actions/checkout@v3 + - run: deno task test:examples:browser diff --git a/.github/workflows/examples-browser.yml b/.github/workflows/examples-browser.yml deleted file mode 100644 index f87bb5167..000000000 --- a/.github/workflows/examples-browser.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Examples (Browser) - -on: - pull_request: - merge_group: - push: - branches: - - main - -jobs: - run-tests: - runs-on: ubuntu-latest - timeout-minutes: 15 - container: - image: ghcr.io/paritytech/trun:main - steps: - - uses: actions/checkout@v3 - - run: deno task capi -- deno run -A -r=http://localhost:4646/ /trun/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser diff --git a/.github/workflows/examples-deno.yml b/.github/workflows/examples-deno.yml deleted file mode 100644 index e9c4e0e8b..000000000 --- a/.github/workflows/examples-deno.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Examples (Deno) - -on: - pull_request: - merge_group: - push: - branches: - - main - -jobs: - run-tests: - runs-on: ubuntu-latest - timeout-minutes: 15 - container: - image: ghcr.io/paritytech/trun:main - steps: - - uses: actions/checkout@v3 - - run: deno task capi -- deno run -A -r=http://localhost:4646/ /trun/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ diff --git a/deno.jsonc b/deno.jsonc index eb2fd97df..a5dc7aa47 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,7 +33,8 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples": "deno task test _tasks/test_examples.ts", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", diff --git a/words.txt b/words.txt index bb0f3616e..6028c1ed8 100644 --- a/words.txt +++ b/words.txt @@ -212,6 +212,7 @@ tpeyg transcoders trufflehog trufflesecurity +trun twind twox typebox From baf5c1b02764de537a237440c4ef6eccc66e4a7b Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Mon, 3 Apr 2023 20:14:05 -0400 Subject: [PATCH 04/17] add trun ignore --- .trunignore | 5 +++++ examples/.ignore | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .trunignore delete mode 100644 examples/.ignore diff --git a/.trunignore b/.trunignore new file mode 100644 index 000000000..5825f77f8 --- /dev/null +++ b/.trunignore @@ -0,0 +1,5 @@ +**/multisig/{basic,stash,virtual}.eg.ts +**/xcm/asset_teleportation.eg.ts +**/smoldot.eg.ts +**/ink/*.eg.ts +**/sign/ed25519.eg.ts diff --git a/examples/.ignore b/examples/.ignore deleted file mode 100644 index 70c4db99f..000000000 --- a/examples/.ignore +++ /dev/null @@ -1,3 +0,0 @@ -ink/deploy.eg.ts -smoldot.eg.ts -xcm/asset_teleportation.ts From 1d3ad498251d0d5d821a194ec7c125e7389bb2a1 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Mon, 3 Apr 2023 20:16:06 -0400 Subject: [PATCH 05/17] update workflow --- deno.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index a5dc7aa47..e1649c2a0 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,8 +33,8 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", - "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --dir examples --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/feat/glob-search/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/feat/glob-search/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From cc2b7de4974d73659ec2764c3c4aaf8f628c60a5 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Wed, 5 Apr 2023 15:09:13 -0400 Subject: [PATCH 06/17] rebase --- deno.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index e1649c2a0..b968d041f 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,8 +33,8 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/feat/glob-search/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", - "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/feat/glob-search/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From 9f32ba03e7fb89c4eb390429bb7c410bd6a647c8 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 10:43:32 -0400 Subject: [PATCH 07/17] remove browser workflow --- .github/workflows/checks.yml | 9 --------- deno.jsonc | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b05ead24d..d5986b885 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -108,12 +108,3 @@ jobs: target/capi/**/_chainName key: ${{ runner.os }}-capi-metadata-${{ hashFiles('import_map.json') }} - run: deno task test:examples:deno - test-examples-browser: - name: Test Examples (Browser) - runs-on: ubuntu-latest - timeout-minutes: 15 - container: - image: ghcr.io/paritytech/trun:main - steps: - - uses: actions/checkout@v3 - - run: deno task test:examples:browser diff --git a/deno.jsonc b/deno.jsonc index b968d041f..4030d0625 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,8 +33,7 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", - "test:examples:browser": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/main/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/ --browser", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/v0.1.0-beta.1/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From 32d41e46fbcabdcc451ac4d90229bb1a8f4e0e89 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 10:44:50 -0400 Subject: [PATCH 08/17] update trun ignore --- .trunignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.trunignore b/.trunignore index 5825f77f8..72e8d54f8 100644 --- a/.trunignore +++ b/.trunignore @@ -1,5 +1,3 @@ -**/multisig/{basic,stash,virtual}.eg.ts **/xcm/asset_teleportation.eg.ts **/smoldot.eg.ts **/ink/*.eg.ts -**/sign/ed25519.eg.ts From 197fa4b4525238fb9cf20216d94223af60ee4f99 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 12:42:10 -0400 Subject: [PATCH 09/17] address comments --- .github/workflows/checks.yml | 4 ++-- .trunignore | 6 +++--- deno.jsonc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d5986b885..efeeaa928 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -84,8 +84,8 @@ jobs: target/capi/**/_chainName key: ${{ runner.os }}-capi-metadata-${{ hashFiles('import_map.json') }} - run: deno task test - test-examples-deno: - name: Test Examples (Deno) + examples-deno: + name: Examples (Deno) runs-on: ubuntu-latest timeout-minutes: 15 steps: diff --git a/.trunignore b/.trunignore index 72e8d54f8..1123780eb 100644 --- a/.trunignore +++ b/.trunignore @@ -1,3 +1,3 @@ -**/xcm/asset_teleportation.eg.ts -**/smoldot.eg.ts -**/ink/*.eg.ts +examples/xcm/asset_teleportation.eg.ts +examples/smoldot.eg.ts +examples/ink/*.eg.ts diff --git a/deno.jsonc b/deno.jsonc index 4030d0625..c5d876ce9 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,7 +33,7 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/v0.1.0-beta.1/main.ts --include \"*/**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/v0.1.0-beta.1/main.ts --include \"**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From c3f074968cf269d0a630d11f261d7b070c22af49 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 15:55:11 -0400 Subject: [PATCH 10/17] use deno land urls --- deno.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.jsonc b/deno.jsonc index c5d876ce9..7ba155363 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,7 +33,7 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://raw.githubusercontent.com/paritytech/trun/v0.1.0-beta.1/main.ts --include \"**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://deno.land/x/trun@v0.1.0-beta.2/main.ts --include \"**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From 74aa2e3088d30faf4a3b620171399d4139628f01 Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Thu, 6 Apr 2023 16:33:21 -0400 Subject: [PATCH 11/17] fix u track example error --- examples/rune/u_track.eg.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rune/u_track.eg.ts b/examples/rune/u_track.eg.ts index a7ea355a2..995b02438 100644 --- a/examples/rune/u_track.eg.ts +++ b/examples/rune/u_track.eg.ts @@ -50,7 +50,7 @@ const unReHandled = await start .map((msg) => `**${msg}**`) .rehandle(MyError) .run() -console.log("(Un|Re)handled", unReHandled) +console.log("(Un|Re)handled:", unReHandled) assert(unReHandled === `**${INITIAL_MSG}**` || unReHandled instanceof MyError) // When rehandling, we can optionally specify the alternative execution, as we do with `handle`. @@ -59,4 +59,4 @@ const unReHandledWithFallback = await start .rehandle(MyError, () => Rune.constant(RECOVERY_MSG)) .run() console.log("(Un|Re)handled with fallback:", unReHandledWithFallback) -assert(unReHandledWithFallback === `**${INITIAL_MSG}**` || unReHandledWithFallback === RECOVERY_MSG) +assert(unReHandledWithFallback === INITIAL_MSG || unReHandledWithFallback === RECOVERY_MSG) From 25bff9e75e39612bf714290d8e1f80799bb62f9d Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 17:12:38 -0400 Subject: [PATCH 12/17] increase timeout --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index efeeaa928..5ab20a3d9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -87,7 +87,7 @@ jobs: examples-deno: name: Examples (Deno) runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 20 steps: - uses: actions/checkout@v3 - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 # v1.1.0 From 3c33c1cbcb3a4360e2849e521b78506a124c9969 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 17:39:28 -0400 Subject: [PATCH 13/17] increase timeouts more --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 5ab20a3d9..6f019ec0e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -87,7 +87,7 @@ jobs: examples-deno: name: Examples (Deno) runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 30 steps: - uses: actions/checkout@v3 - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 # v1.1.0 From 0a18ff19e974623ea178aac488f666b70207aacd Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 17:55:10 -0400 Subject: [PATCH 14/17] break subscription example on 3 tries --- .github/workflows/checks.yml | 2 +- examples/raw_rpc/subscription.eg.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6f019ec0e..efeeaa928 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -87,7 +87,7 @@ jobs: examples-deno: name: Examples (Deno) runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 steps: - uses: actions/checkout@v3 - uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54 # v1.1.0 diff --git a/examples/raw_rpc/subscription.eg.ts b/examples/raw_rpc/subscription.eg.ts index a2603a600..2c6e51a92 100644 --- a/examples/raw_rpc/subscription.eg.ts +++ b/examples/raw_rpc/subscription.eg.ts @@ -12,8 +12,13 @@ const headerIter = chain.connection .subscribe("chain_subscribeFinalizedHeads", "chain_unsubscribeAllHeads") .iter() +let count = 0 // Iterate over its items and ensure they conform to the expected shape. for await (const header of headerIter) { $.assert(known.$header, header) console.log(header) + count += 1 + if (count === 3) { + break + } } From ab349edfa31231d90f08595efd5f22eb7453731b Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 18:02:36 -0400 Subject: [PATCH 15/17] set concurrency to 4 --- deno.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.jsonc b/deno.jsonc index 7ba155363..e87ed75e4 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,7 +33,7 @@ "udd": "deno run -A _tasks/udd.ts", "dnt": "deno task run _tasks/dnt.ts", "test": "deno task capi -- deno test -A -L=info --ignore=target --parallel -r=http://localhost:4646/", - "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://deno.land/x/trun@v0.1.0-beta.2/main.ts --include \"**/*.eg.ts\" --import-map import_map.json --concurrency 1 --reload http://localhost:4646/", + "test:examples:deno": "deno task capi -- deno run -A -r=http://localhost:4646/ https://deno.land/x/trun@v0.1.0-beta.2/main.ts --include \"**/*.eg.ts\" --import-map import_map.json --concurrency 4 --reload http://localhost:4646/", "test:update": "deno task test -- --update", "moderate": "deno run -A https://deno.land/x/moderate@0.0.5/mod.ts --exclude '*.test.ts' && dprint fmt", "capi": "deno run -A main.ts", From 331eefadc523c3c0c43b5bb7fdfead2a2cf848da Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 18:08:51 -0400 Subject: [PATCH 16/17] formatting --- examples/raw_rpc/subscription.eg.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/raw_rpc/subscription.eg.ts b/examples/raw_rpc/subscription.eg.ts index 2c6e51a92..18cb83c0f 100644 --- a/examples/raw_rpc/subscription.eg.ts +++ b/examples/raw_rpc/subscription.eg.ts @@ -18,7 +18,5 @@ for await (const header of headerIter) { $.assert(known.$header, header) console.log(header) count += 1 - if (count === 3) { - break - } + if (count === 3) break } From df3910c165f196b5adad41935b914249d68cf0dc Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 6 Apr 2023 18:28:01 -0400 Subject: [PATCH 17/17] shiki fix --- deps/shiki.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/shiki.ts b/deps/shiki.ts index 9ad2f37c3..ace333d60 100644 --- a/deps/shiki.ts +++ b/deps/shiki.ts @@ -1,4 +1,4 @@ -import * as shiki from "https://esm.sh/shiki@0.14.1?bundle" +import * as shiki from "https://esm.sh/v113/shiki@0.14.1?bundle" import typescriptLang from "https://unpkg.com/shiki@0.14.1/languages/typescript.tmLanguage.json" assert { type: "json", }