From f4aecafbcd375d30809ef7123f34434bb55f9ef4 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 11 Sep 2024 14:45:55 -0700 Subject: [PATCH] kit run-tests: add minor update --- .github/workflows/mdbook.yml | 39 ++++++++++++++++++++++++-------- code/mfa_fe_demo/test/tests.toml | 2 +- src/kit/run-tests.md | 4 ++-- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/mdbook.yml b/.github/workflows/mdbook.yml index 768f115..e37752a 100644 --- a/.github/workflows/mdbook.yml +++ b/.github/workflows/mdbook.yml @@ -82,6 +82,30 @@ jobs: run: tar zxf foundry.tar.gz - name: Add Foundry to path run: echo "$PWD" >> $GITHUB_PATH + + - name: Get latest release from kinode-dao/kit + id: get-latest-kit-release + uses: actions/github-script@v6 + with: + script: | + const repo = { + owner: 'kinode-dao', + repo: 'kit', + }; + const release = await github.rest.repos.getLatestRelease(repo); + const asset = release.data.assets.find(asset => asset.name.match(/kit-x86_64-unknown-linux-gnu\.zip/)); + if (!asset) { + throw new Error('Asset not found'); + } + return asset.browser_download_url; + result-encoding: string + - name: Download the Kit release + run: wget -q ${DOWNLOAD_URL} -O kit.zip + env: + DOWNLOAD_URL: ${{ steps.get-latest-kit-release.outputs.result }} + - name: Unzip the release + run: unzip kit.zip + #- name: Get latest release from kinode-dao/kit # id: get-latest-kit-release # uses: actions/github-script@v6 @@ -89,25 +113,20 @@ jobs: # script: | # const repo = { # owner: 'kinode-dao', - # repo: 'kit', + # repo: 'kinode', # }; # const release = await github.rest.repos.getLatestRelease(repo); - # const asset = release.data.assets.find(asset => asset.name.match(/kit-x86_64-unknown-linux-gnu\.zip/)); + # const asset = release.data.assets.find(asset => asset.name.match(/kinode-x86_64-unknown-linux-gnu\.zip/)); # if (!asset) { # throw new Error('Asset not found'); # } # return asset.browser_download_url; # result-encoding: string - - name: Download the Kit release - run: wget -q https://files.yael.solutions/240906/kit-x86_64-unknown-linux-gnu.zip -O kit.zip - #run: wget -q ${DOWNLOAD_URL} -O kit.zip - #env: - # DOWNLOAD_URL: ${{ steps.get-latest-kit-release.outputs.result }} - - name: Unzip the release - run: unzip kit.zip - - name: Download the Kinode release run: wget -q https://files.yael.solutions/240906/kinode-x86_64-unknown-linux-gnu-simulation-mode.zip -O kinode.zip + #run: wget -q ${DOWNLOAD_URL} -O kinode.zip + #env: + # DOWNLOAD_URL: ${{ steps.get-latest-kit-release.outputs.result }} - name: Unzip the Kinode release run: unzip kinode.zip diff --git a/code/mfa_fe_demo/test/tests.toml b/code/mfa_fe_demo/test/tests.toml index 0709f66..bdc1709 100644 --- a/code/mfa_fe_demo/test/tests.toml +++ b/code/mfa_fe_demo/test/tests.toml @@ -12,7 +12,7 @@ setup_packages = [ setup_scripts = [] test_package_paths = ["mfa_fe_demo_test"] test_scripts = [ - { path = "../curl-endpoint.sh", args = "" }, + "../curl-endpoint.sh", ] timeout_secs = 5 fakechain_router = 8545 diff --git a/src/kit/run-tests.md b/src/kit/run-tests.md index 7d0aa96..5614cec 100644 --- a/src/kit/run-tests.md +++ b/src/kit/run-tests.md @@ -110,9 +110,9 @@ Key | Value Type -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- `dependency_package_paths` | Array of Strings (`PathBuf`s) | Paths to packages to load onto dependency node so that setup or test packages can fetch them to fulfil `dependencies` `setup_packages` | Array of Tables [(`SetupPackage`s)](https://github.com/kinode-dao/kit/blob/10e2bd5d44cf44690c2360e60523ac5b06d1d5f0/src/run_tests/types.rs#L37-L40) | Each Table in the Array contains `path` (to the package) and `run` (whether or not to run the package or merely load it in) -`setup_scripts` | Array of Tables [(`Script`s)](https://github.com/kinode-dao/kit/blob/10e2bd5d44cf44690c2360e60523ac5b06d1d5f0/src/run_tests/types.rs#L43-L46) | Each Table in the Array contains `path` (to the script) and `args` (to be passed to the script); these scripts will run alongside the test nodes +`setup_scripts` | Array of Strings (`bash` line) | Each Table in the Array contains `path` (to the script) and `args` (to be passed to the script); these scripts will run alongside the test nodes `test_package_paths` | Array of Strings (`PathBuf`s) | Paths to test packages to run -`test_scripts` | Array of [`Script`s](https://github.com/kinode-dao/kit/blob/10e2bd5d44cf44690c2360e60523ac5b06d1d5f0/src/run_tests/types.rs#L43-L46) | Each Table in the Array contains `path` (to the script) and `args` (to be passed to the script); these scripts will be run as tests and must return a `0` on success +`test_scripts` | Array of Strings (`bash` line) | Each Table in the Array contains `path` (to the script) and `args` (to be passed to the script); these scripts will be run as tests and must return a `0` on success `timeout_secs` | Integer > 0 | Timeout for this entire series of test packages `fakechain_router` | Integer >= 0 | Port to be bound by anvil, where fakechain will be hosted [`nodes`](#nodes) | Array of Tables | Each Table specifies configuration of one node to spin up for test