Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove ens-related deployers, adjust deploy tests #1839

Merged
merged 3 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
90 changes: 14 additions & 76 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,36 +74,20 @@ describe("e2e tests for deploy command", () => {
});

it("Should deploy the project successfully", async () => {
const { exitCode: code, stdout: output, stderr } = 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);

console.log(output)
console.error(stderr);
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 @@ -131,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 @@ -207,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 @@ -286,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 @@ -298,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 @@ -319,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

This file was deleted.

This file was deleted.

Loading