Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
86b0b72
chore: fix templates test
dOrgJelli Jul 16, 2023
c79121c
fix: go codegen properly formats serialized properties
dOrgJelli Jul 16, 2023
0c48b7c
chore: add wrap-rust abi-bindgen wrap
dOrgJelli Jul 16, 2023
8716e2f
chore: remove debug logging
dOrgJelli Jul 16, 2023
a99bea1
chore: update wrap test harness branch
cbrzn Jul 18, 2023
352f045
Merge branch 'origin-dev' into green-ci
dOrgJelli Jul 18, 2023
78a8e04
chore: fix rust builds
dOrgJelli Jul 18, 2023
8a714bc
chore: add back rust plugin template tests
dOrgJelli Jul 18, 2023
90b3f1b
chore: remove bind test-case output
dOrgJelli Jul 18, 2023
bee8a22
chore: upgrade to 0.12 client
dOrgJelli Jul 26, 2023
bd98bbd
chore: remove ethereum-provider
dOrgJelli Jul 26, 2023
2d1a6b6
Merge branch 'green-ci' into default-config-update
dOrgJelli Jul 26, 2023
415cd55
Merge pull request #1837 from polywrap/default-config-update
dOrgJelli Jul 26, 2023
d49ee47
chore: merge origin-dev
dOrgJelli Jul 26, 2023
9540953
chore: fix ens deploy test
dOrgJelli Jul 26, 2023
a029f7d
chore: update testing order
dOrgJelli Jul 27, 2023
0fba350
chore: enable deploy tests
dOrgJelli Jul 27, 2023
3fdaaf3
Remove ens-related deployers, adjust deploy tests
pileks Jul 27, 2023
eb6f0e4
chore: lint
pileks Jul 27, 2023
fa6cad4
fix help text test for build command
pileks Jul 28, 2023
1a63800
Merge pull request #1839 from polywrap/pileks/chore/remove-ens-deployer
dOrgJelli Jul 29, 2023
efe2af4
chore: remove plugin-rs bind test case
dOrgJelli Jul 29, 2023
90e9c1e
Merge branch 'origin-dev' into green-ci
dOrgJelli Jul 29, 2023
1d65a13
chore: fix js cli test
dOrgJelli Jul 29, 2023
e5bf829
Merge branch 'green-ci' of https://github.com/polywrap/cli into green-ci
dOrgJelli Jul 29, 2023
d58ef10
chore: fix validation tests
dOrgJelli Jul 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 60 additions & 12 deletions .github/workflows/ci-javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ jobs:
CI-WRAP-Test-Harness:
uses: ./.github/workflows/ci-wrap-test-harness.yaml

Test-Core:
Test-Templates:
runs-on: ubuntu-latest
needs: CI-WRAP-Test-Harness
timeout-minutes: 60
if: ${{ always() }}
steps:
Expand Down Expand Up @@ -139,18 +138,63 @@ jobs:
- name: Build
run: yarn build

- name: Get updated wrappers
if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
uses: actions/download-artifact@v3
id: get-wrappers
- name: Test
run: yarn test:templates

Test-Core:
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

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

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

- if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
run: |
rm -rf packages/test-cases/cases/wrappers
mv wrappers packages/test-cases/cases
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.4.2'

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.13.1'

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

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

- 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

- name: Build
run: yarn build

- name: Test
run: yarn test:core
Expand Down Expand Up @@ -224,3 +268,7 @@ jobs:
- name: Test cli:e2e:p2
run: yarn test:e2e:p2
working-directory: ./packages/cli

- name: Test CLI JS
run: yarn test
working-directory: ./packages/js/cli
2 changes: 1 addition & 1 deletion WRAP_TEST_HARNESS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master
chore/latest-rust-wrap-bindings
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@
"lint:fix": "lerna run lint -- --fix",
"lint:ci": "yarn lint",
"test": "lerna run test --no-private --concurrency 1",
"test:core": "lerna run test --no-private --ignore polywrap* --concurrency 1",
"test:cli": "yarn test:cli:unit && yarn test:cli:e2e",
"test:cli:unit": "lerna run test:unit --no-private --scope polywrap --concurrency 1",
"test:cli:e2e:p1": "lerna run test:e2e:p1 --no-private --scope polywrap --concurrency 1",
"test:cli:e2e:p2": "lerna run test:e2e:p2 --no-private --scope polywrap --concurrency 1",
"test:core": "lerna run test --no-private --ignore polywrap* --ignore @polywrap/cli-js --ignore @polywrap/templates --concurrency 1",
"test:cli": "yarn test:cli:unit && yarn test:cli:e2e && yarn test:cli:js",
"test:cli:unit": "lerna run test:unit --scope polywrap --concurrency 1",
"test:cli:e2e": "yarn test:cli:e2e:p1 && yarn test:cli:e2e:p2",
"test:cli:e2e:p1": "lerna run test:e2e:p1 --scope polywrap --concurrency 1",
"test:cli:e2e:p2": "lerna run test:e2e:p2 --scope polywrap --concurrency 1",
"test:cli:js": "lerna run test --scope @polywrap/cli-js --concurrency 1",
"test:templates": "lerna run test --no-private --scope @polywrap/templates --concurrency 1",
"version:apply": "lerna version $(cat VERSION) --exact --no-git-tag-version --yes",
"postversion:apply": "git add . && git commit -m \"build(release): migrate to `cat ./VERSION`\"",
"publish:npm": "lerna exec --no-private --concurrency 1 -- yarn publish --access public --non-interactive --verbose",
Expand Down
24 changes: 12 additions & 12 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@
"@ethersproject/providers": "5.6.8",
"@ethersproject/wallet": "5.6.2",
"@formatjs/intl": "1.8.2",
"@polywrap/asyncify-js": "0.12.0-pre.1",
"@polywrap/client-config-builder-js": "0.12.0-pre.1",
"@polywrap/client-js": "0.12.0-pre.1",
"@polywrap/core-js": "0.12.0-pre.1",
"@polywrap/ethereum-provider-js": "0.3.1",
"@polywrap/asyncify-js": "0.12.0",
"@polywrap/client-config-builder-js": "0.12.0",
"@polywrap/client-js": "0.12.0",
"@polywrap/core-js": "0.12.0",
"@polywrap/ethereum-wallet-js": "~0.1.0",
"@polywrap/logging-js": "0.11.0-pre.4",
"@polywrap/os-js": "0.11.0-pre.4",
"@polywrap/polywrap-manifest-types-js": "0.11.0-pre.4",
"@polywrap/result": "0.12.0-pre.1",
"@polywrap/result": "0.12.0",
"@polywrap/schema-bind": "0.11.0-pre.4",
"@polywrap/schema-compose": "0.11.0-pre.4",
"@polywrap/schema-parse": "0.11.0-pre.4",
"@polywrap/sys-config-bundle-js": "0.12.0-pre.1",
"@polywrap/uri-resolver-extensions-js": "0.12.0-pre.1",
"@polywrap/uri-resolvers-js": "0.12.0-pre.1",
"@polywrap/wasm-js": "0.12.0-pre.1",
"@polywrap/web3-config-bundle-js": "0.12.0-pre.1",
"@polywrap/wrap-manifest-types-js": "0.12.0-pre.1",
"@polywrap/sys-config-bundle-js": "0.12.0",
"@polywrap/uri-resolver-extensions-js": "0.12.0",
"@polywrap/uri-resolvers-js": "0.12.0",
"@polywrap/wasm-js": "0.12.0",
"@polywrap/web3-config-bundle-js": "0.12.0",
"@polywrap/wrap-manifest-types-js": "0.12.0",
"axios": "0.21.2",
"chalk": "4.1.0",
"chokidar": "3.5.1",
Expand Down
87 changes: 14 additions & 73 deletions packages/cli/src/__tests__/e2e/p1/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ const setup = async () => {
process.env = {
...process.env,
IPFS_GATEWAY_URI: ETH_ENS_IPFS_MODULE_CONSTANTS.ipfsProvider,
DOMAIN_NAME: "test1.eth",
ENS_REG_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.ensAddress,
ENS_REGISTRAR_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.registrarAddress,
ENS_RESOLVER_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.resolverAddress,
};
}

Expand Down Expand Up @@ -78,33 +74,20 @@ describe("e2e tests for deploy command", () => {
});

it("Should deploy the project successfully", async () => {
const { exitCode: code, stdout: output } = await Commands.deploy({}, {
const { exitCode: code, stdout: output, stderr: error } = await Commands.deploy({}, {
cwd: getTestCaseDir(0),
cli: polywrapCli,
env: process.env as Record<string, string>
});

const sanitizedOutput = clearStyle(output);
const sanitizedError = clearStyle(error);

expect(code).toEqual(0);
expect(sanitizedError).toBeFalsy();
expect(sanitizedOutput).toContain(
"Successfully executed step 'ipfs_deploy'"
);
expect(sanitizedOutput).toContain(
"Successfully executed step 'from_deploy'"
);
expect(sanitizedOutput).toContain(
"Successfully executed step 'from_deploy2'"
);
expect(sanitizedOutput).toContain(
"Successfully executed 'fs_to_ens' deployment job"
);
expect(sanitizedOutput).toContain(
"Successfully executed step 'from_uri'"
);
expect(sanitizedOutput).toContain(
"Successfully executed 'ipfs_to_ens' deployment job"
);
});

it("Should output the deployment uri to URI.txt", async () => {
Expand All @@ -128,7 +111,7 @@ describe("e2e tests for deploy command", () => {

const sanitizedOutput = clearStyle(output);
expect(sanitizedOutput).toContain(
`The URI result from job fs_to_ens has been written to ${deploymentFilePath}. ` +
`The URI result from job fs_to_ipfs has been written to ${deploymentFilePath}. ` +
"It is recommended to store this file at the root of your wrap package and commit it to your repository.",
);
});
Expand Down Expand Up @@ -204,57 +187,16 @@ describe("e2e tests for deploy command", () => {
expect(yamlOutputFileContents).toMatchObject(jsonOutputFileContents);
expect(jsonOutputFileContents).toMatchObject([
{
"name": "fs_to_ens",
"name": "fs_to_ipfs",
"steps": [
{
"name": "ens_register",
"id": "fs_to_ens.ens_register",
"input": "wrap://ens/test1.eth",
"result": "wrap://ens/testnet/test1.eth",
},
{
"name": "ens_register2",
"id": "fs_to_ens.ens_register2",
"input": "wrap://ens/test2.eth",
"result": "wrap://ens/testnet/test2.eth",
},
{
"name": "ipfs_deploy",
"id": "fs_to_ens.ipfs_deploy",
"id": "fs_to_ipfs.ipfs_deploy",
"input": "wrap://fs/../wrapper",
"result": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH",
},
{
"name": "from_deploy",
"id": "fs_to_ens.from_deploy",
"input": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH",
"result": "wrap://ens/testnet/test1.eth",
},
{
"name": "from_deploy2",
"id": "fs_to_ens.from_deploy2",
"input": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH",
"result": "wrap://ens/testnet/test2.eth",
}
]
},
{
"name": "ipfs_to_ens",
"steps": [
{
"name": "ens_register",
"id": "ipfs_to_ens.ens_register",
"input": "wrap://ens/test3.eth",
"result": "wrap://ens/testnet/test3.eth",
},
{
"name": "from_uri",
"id": "ipfs_to_ens.from_uri",
"input": "wrap://ipfs/QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF",
"result": "wrap://ens/testnet/test3.eth",
}
]
}
])
});

Expand Down Expand Up @@ -283,7 +225,7 @@ describe("e2e tests for deploy command", () => {
const sanitizedErr = clearStyle(stderr);

expect(code).toEqual(1);
expect(sanitizedErr).toContain("domainName is not of a type(s) string")
expect(sanitizedErr).toContain("gatewayUri is not of a type(s) string")
});

it("Should throw and stop chain if error is found", async () => {
Expand All @@ -295,18 +237,17 @@ describe("e2e tests for deploy command", () => {

const sanitizedOutput = clearStyle(output);
const sanitizedErr = clearStyle(stderr);

expect(code).toEqual(1);

expect(sanitizedOutput).toContain(
"Successfully executed step 'ipfs_deploy'"
"Successfully executed step 'ipfs_deploy_1'"
);
expect(sanitizedOutput).not.toContain(
"Successfully executed step 'from_deploy2'"
"Successfully executed step 'from_deploy_3'"
);

expect(sanitizedErr).toContain(
"Failed to execute step 'from_deploy'"
expect(sanitizedErr.replace("\n", "")).toContain(
"Failed to execute step 'ipfs_deploy_2'"
);
expect(code).toEqual(1);
});

it("Should throw if environment variable is not loaded but defined in manifest", async () => {
Expand All @@ -316,7 +257,7 @@ describe("e2e tests for deploy command", () => {
env: process.env as Record<string, string>
});
const sanitizedErr = clearStyle(stderr);
expect(code).toEqual(1);
expect(sanitizedErr).toContain("Environment variable not found: `NON_LOADED_VAR`");
expect(code).toEqual(1);
});
});
4 changes: 4 additions & 0 deletions packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Options:
(default: polywrap.yaml | polywrap.yml)
-o, --output-dir <path> Output directory for build results
(default: ./build)
-b, --bindgen <URI> Uri for custom bindgen wrap (must
implement wrap-abi-bindgen interface;
see
https://github.com/polywrap/wrap-abi-bindgen)
-c, --client-config <config-path> Add custom configuration to the
PolywrapClient
-n, --no-codegen Skip code generation before build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { parseWrapperEnvsOption } from "../../../lib";
describe("unit tests for option-parsers", () => {
describe("wrapper-envs", () => {
const sampleFileEnvs = {
"wrap://ens/wraps.eth:ethereum@1.0.0": {
connection: {
networkNameOrChainId: "mainnet",
node: "https://mainnet.infura.io/v3/some_api_key",
"wrap://authority/wrap": {
prop: {
value: "bar",
value2: 2,
},
},
"wrap://ens/hello-world.polywrap.eth": { foo: "bar" },
"wrap://authority/some-wrap": { foo: "bar" },
};

it("Should return undefined when undefined is provided for wrapperEnvsPath", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"ens/hello-world.polywrap.eth": {
"foo": "bar"
},
"ens/wraps.eth:ethereum@1.0.0": {
"connection": {
"node": "https://mainnet.infura.io/v3/some_api_key",
"networkNameOrChainId": "mainnet"
"authority/some-wrap": { "foo": "bar" },
"authority/wrap": {
"prop": {
"value": "bar",
"value2": 2
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ens/hello-world.polywrap.eth:
authority/some-wrap:
foo: bar
ens/wraps.eth:ethereum@1.0.0:
connection:
node: https://mainnet.infura.io/v3/some_api_key
networkNameOrChainId: mainnet
authority/wrap:
prop:
value: bar
value2: 2
Loading