Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c6c10d1
feat: wrappers fetched from wasm harness first iteration
cbrzn Jan 1, 2023
6ab3586
Merge branch 'origin-dev' into feat/new-test-cases
cbrzn Jan 7, 2023
47b6a82
chore(cli): workflow job runner tests updated
cbrzn Jan 7, 2023
e298bc7
chore(js/client): almost all core tests updated
cbrzn Jan 7, 2023
96b914e
chore: update wasm and core client tests
cbrzn Jan 8, 2023
73de2ea
chore: remove wrappers folder & ignore it in git
cbrzn Jan 9, 2023
704c35b
chore: uri resolution & error structure tests updated
cbrzn Jan 9, 2023
66e918e
chore: client test restructured
cbrzn Jan 10, 2023
86fdae6
chore: job runner tests updated
cbrzn Jan 11, 2023
7f246db
chore: fix rust ci
cbrzn Jan 11, 2023
68db1ad
chore: solved conflicts with origin-dev
cbrzn Jan 11, 2023
380b7df
chore: validate test fixed
cbrzn Jan 11, 2023
c325aa1
chore: add generate wrappers script in ci
cbrzn Jan 11, 2023
c3cef10
chore(wip): use releases and unzip to get wrappers instead of tag & c…
cbrzn Jan 11, 2023
7e26561
chore: fetch and unzip wrappers implemented
cbrzn Jan 12, 2023
75ea0e8
chore: update fetch wrappers script to pull the latest
cbrzn Jan 12, 2023
290d5a9
chore: remove type module from test case package json
cbrzn Jan 12, 2023
c3ecaba
Merge branch 'origin-dev' into feat/new-test-cases
cbrzn Jan 16, 2023
4125781
chore: update dev guidelines & remove unncessary changes from rs-ci
cbrzn Jan 16, 2023
dc1525d
update with latest from origin-dev
cbrzn Jan 18, 2023
9c9566c
js/test-env: move deploy to one function and use it from different tests
cbrzn Jan 18, 2023
492dce6
chore: fix lint & fs resolver test
cbrzn Jan 19, 2023
514b356
Merge branch 'origin-dev' into feat/new-test-cases
cbrzn Jan 19, 2023
1e74e05
chore: fix http test
cbrzn Jan 19, 2023
943449c
chore: update with latest & update readmes of uri resolver plugins
cbrzn Jan 23, 2023
07e5e7f
js/test-env: fix lint
cbrzn Jan 23, 2023
fd59032
ci: updated with generate wrappers reusable workflow & update dev gui…
cbrzn Jan 23, 2023
5b008af
ci: add generation of modified tests wrappers reusable workflow
cbrzn Jan 25, 2023
026067f
ci: add dependency of generate-test-wrappers in rust
cbrzn Jan 25, 2023
aac2d63
test-cases: make fetch wrappers async & fix typo in dev guidelines
cbrzn Feb 4, 2023
4fd6c54
chore: fix conflicts
cbrzn Feb 4, 2023
1ce344c
client/tests: invoke wrapper of compatible version almost works
cbrzn Feb 4, 2023
0d6b424
client/tests: incompatible version wrapper invocation
cbrzn Feb 6, 2023
5744fe2
client/tests: incompatible version plugin invocation
cbrzn Feb 6, 2023
b7bf152
merge: origin-dev
dOrgJelli Feb 16, 2023
30e911b
update with origin-dev
cbrzn Feb 16, 2023
a6945a7
test-cases/fetch-wrappers: update with latest asset release
cbrzn Feb 16, 2023
8b63ea7
ci(wrapper-generation-script): use head branch instead of base
cbrzn Feb 16, 2023
91cca19
chore: fix conflicts & test
cbrzn Feb 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
82 changes: 80 additions & 2 deletions .github/workflows/ci-javascript.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI-Javascript

on:
on:
push:
branches:
- origin
Expand Down Expand Up @@ -44,9 +44,37 @@ jobs:
- name: Build
run: yarn build

Check-Changed-Folders:
runs-on: ubuntu-latest
outputs:
should-generate: ${{ env.should-generate }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: |
packages/cli/*
packages/schema/*
packages/wasm/*
- id: set-output
run: echo "should-generate=${{steps.changed-files.outputs.any_changed}}" >> $GITHUB_ENV

Generate-Test-Wrappers:
needs: Check-Changed-Folders
if: ${{ needs.Check-Changed-Folders.outputs.should-generate == 'true' }}
uses: ./.github/workflows/generate-modified-test-wrappers.yaml
with:
cli-path: /toolchain/packages/cli
wasm-path: /toolchain/packages/wasm

Test-Core:
runs-on: ubuntu-latest
needs: Generate-Test-Wrappers
timeout-minutes: 60
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -87,11 +115,24 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:core

Test-Plugins:
runs-on: ubuntu-latest
needs: Generate-Test-Wrappers
if: ${{ always() }}
timeout-minutes: 60
steps:
- name: Checkout repository
Expand Down Expand Up @@ -123,11 +164,24 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:plugins

Test-Client:
runs-on: ubuntu-latest
needs: Generate-Test-Wrappers
if: ${{ always() }}
timeout-minutes: 60
steps:
- name: Checkout repository
Expand Down Expand Up @@ -159,11 +213,24 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:client

Test-Cli:
runs-on: ubuntu-latest
needs: Generate-Test-Wrappers
if: ${{ always() }}
timeout-minutes: 60
steps:
- name: Checkout repository
Expand All @@ -184,7 +251,7 @@ jobs:

- name: Install cue lang
run: go install cuelang.org/go/cmd/cue@latest

- name: Check if cue is installed
run: cue version

Expand All @@ -205,6 +272,17 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:cli

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/ci-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,36 @@ jobs:
working-directory: ./packages/wasm/rs
run: cargo doc --workspace --no-deps

Check-Changed-Folders:
runs-on: ubuntu-latest
outputs:
should-generate: ${{ env.should-generate }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: |
packages/cli/*
packages/schema/*
packages/wasm/*
- id: set-output
run: echo "should-generate=${{steps.changed-files.outputs.any_changed}}" >> $GITHUB_ENV

Generate-Test-Wrappers:
needs: Check-Changed-Folders
if: ${{ needs.Check-Changed-Folders.outputs.should-generate == 'true' }}
uses: ./.github/workflows/generate-modified-test-wrappers.yaml
with:
cli-path: /toolchain/packages/cli
wasm-path: /toolchain/packages/wasm

Test-Cases:
needs: Generate-Test-Wrappers
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -88,12 +116,26 @@ jobs:
- name: Build
run: yarn build


- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:rust
working-directory: ./packages/js/client

Test-Cli:
runs-on: ubuntu-latest
needs: Generate-Test-Wrappers
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -124,6 +166,17 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
uses: actions/download-artifact@v2
id: get-wrappers
with:
name: wrappers

- name: If wrappers exists, update them
if: steps.get-wrappers.outputs.exists == 'true'
run: rm -rf packages/test-cases/wrappers |
mv wrappers packages/test-cases/wrappers

- name: Test
run: yarn test:rust
working-directory: ./packages/cli
91 changes: 91 additions & 0 deletions .github/workflows/generate-modified-test-wrappers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: generate-wrappers

on:
workflow_call:
inputs:
cli-path:
required: false
type: string
wasm-path:
required: false
type: string

jobs:
generate_wrappers:
name: Generate wrappers
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Comment thread
cbrzn marked this conversation as resolved.
uses: actions/checkout@v2
with:
repository: polywrap/wasm-test-harness
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
path: toolchain
fetch-depth: 0

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
working-directory: ./toolchain

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
working-directory: ./toolchain

- name: Build toolchain
run: yarn build
working-directory: ./toolchain

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/
./target/
key: cargo-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-${{ github.job }}

- name: Set environment variable
if: ${{ inputs.cli-path }}
run: echo "POLYWRAP_CLI_PATH=${{ github.workspace }}/${{ inputs.cli-path }}" >> $GITHUB_ENV

- name: Set environment variable
if: ${{ inputs.wasm-path }}
run: echo "POLYWRAP_WASM_PATH=${{ github.workspace }}/${{ inputs.wasm-path }}" >> $GITHUB_ENV

- name: Run wrappers build
run: cargo run -- -w

- uses: actions/upload-artifact@v3
with:
name: wrappers
path: ./wrappers
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ bin
pkg
wasm-pack.log
.env
packages/test-cases/cases/wrappers
8 changes: 8 additions & 0 deletions DEV_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ Some tests rely on validating `stdout` for which Cue is used. If you need to run

You can install Cue by following the instructions found [here](https://cuelang.org/docs/install/).

In the test-cases directory, you can find the `wrappers` folder, which is auto generated from the releases of the
[WASM Test Harness](https://github.com/polywrap/wasm-test-harness), check the `fetchWrappers` function from the [test-cases package](./packages/test-cases/index.ts). These tests are used mostly for client tests, if you would like to
modify them, [follow the development guide of the wasm test harness](https://github.com/polywrap/wasm-test-harness#build--contribute).

If any PR modifies `packages/wasm`, `packages/cli` or `packages/schema`, it will try to generate wrappers on CI based on the changes
introduced on the PR (You can check the workflow in detail [here](https://github.com/polywrap/wasm-test-harness/blob/master/.github/workflows/generate-wrappers.yaml#L14)).
For this, a new branch in the Test Harness need to be opened **with the same name** of the base branch from the PR

## Branches

Currently, there are 2 active branches with configured branch policies:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"reset": "yarn clean && yarn && yarn build",
"clean": "npx rimraf ./**/node_modules ./**/yarn.lock ./**/build ./**/coverage ./**/.polywrap",
"dependencies:install": "cd dependencies && yarn",
"test-wrappers:install": "lerna run generate:wrappers --scope @polywrap/test-cases",
Comment thread
cbrzn marked this conversation as resolved.
"preinstall": "yarn dependencies:install",
"build": "yarn build:core && yarn build:interfaces && yarn link:schema && yarn build:plugins && yarn build:resolver:plugins && yarn build:config && yarn build:core:client && yarn build:client && yarn build:test-env && yarn build:cli",
"build": "yarn build:core && yarn build:interfaces && yarn link:schema && yarn build:plugins && yarn build:resolver:plugins && yarn build:config && yarn build:core:client && yarn build:client && yarn build:test-env && yarn build:cli && yarn test-wrappers:install",
"build:core": "lerna run build --no-private --ignore @polywrap/*-plugin-js --ignore @polywrap/client-config-builder-js --ignore polywrap --ignore @polywrap/core-client-js --ignore @polywrap/client-js --ignore @polywrap/test-env-js --ignore @polywrap/*-interface --ignore @polywrap/cli-js",
"build:interfaces": "lerna run build --scope @polywrap/*-interface",
"build:plugins": "lerna run build --scope @polywrap/*-plugin-js --ignore @polywrap/*-resolver-plugin-js",
Expand Down
Loading