-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* At first, e2e types were generated on postinstall and prebuild steps, but that required metadata to be available in Docker image, even though it's not technically used in the application code. Making e2e types generation a manual step together with excluding tests code from Docker image solved it better. * .scale metadata files from Zombienet hosts saved in the codebase, in order to be able to compile the code separately from running Zombienet * Upgraded both Zombienet and Polkadot in the CI, as well as the docs for e2e tests. * Used persistent path for zombienet nodes' logs, and printing them in CI in case of a failure.
- Loading branch information
1 parent
b644692
commit 990034e
Showing
10 changed files
with
668 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ | |
!tsconfig.json | ||
!env.*.config.json | ||
!src | ||
|
||
/src/**/*.e2e.ts | ||
/src/**/*.spec.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,26 +19,41 @@ jobs: | |
- run: yarn install --frozen-lockfile | ||
- name: Download Polkadot and parachain binaries | ||
run: | | ||
wget --no-verbose https://github.com/paritytech/cumulus/releases/download/v0.9.420/polkadot-parachain | ||
wget --no-verbose https://github.com/paritytech/polkadot/releases/download/v0.9.42/polkadot | ||
wget --no-verbose https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot | ||
wget --no-verbose https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot-parachain | ||
wget --no-verbose https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot-prepare-worker | ||
wget --no-verbose https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.8.0/polkadot-execute-worker | ||
chmod +x ./polkadot* | ||
working-directory: e2e | ||
- name: Run a local relaychain with a parachain using zombienet | ||
run: | | ||
export PATH=$(pwd):$PATH | ||
npx --yes @zombienet/[email protected] \ | ||
--provider native spawn zombienet.native.toml \ | ||
npx --yes @zombienet/[email protected] \ | ||
--provider native \ | ||
--dir zombienet_logs \ | ||
spawn zombienet.native.toml \ | ||
> polkadot.txt 2>&1 & | ||
source wait_until.sh 'curl -s "127.0.0.1:9933"' | ||
source wait_until.sh 'curl -s "127.0.0.1:9934"' | ||
working-directory: e2e | ||
- name: Build e2e types | ||
run: yarn generate:papi:e2e | ||
- name: Build faucet | ||
run: yarn build:docker | ||
- name: Run the E2E tests | ||
run: yarn test:e2e | ||
- name: Debug Polkadot logs | ||
- name: Debug Zombienet host logs | ||
if: failure() | ||
run: cat e2e/polkadot.txt | ||
- name: Debug Zombienet alice node logs | ||
if: failure() | ||
run: cat e2e/zombienet_logs/alice.log | ||
- name: Debug Zombienet bob node logs | ||
if: failure() | ||
run: cat e2e/zombienet_logs/bob.log | ||
- name: Debug Zombienet alice-1 node logs | ||
if: failure() | ||
run: cat e2e/zombienet_logs/alice-1.log | ||
- name: Debug Matrix logs | ||
if: failure() | ||
run: cat e2e/containter_logs/faucet-test-matrix.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ command -v polkadot-parachain || echo "No polkadot-parachain in PATH" | |
Next, in the root of this repository, start the Zombienet: | ||
|
||
```bash | ||
npx --yes @zombienet/[email protected] --provider native spawn e2e/zombienet.native.toml | ||
npx --yes @zombienet/[email protected] --provider native --dir e2e/zombienet_logs spawn e2e/zombienet.native.toml | ||
``` | ||
|
||
Verify that it's working correctly by opening the [relaychain](https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9933#/explorer) and [parachain](https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9934#/explorer) explorers, | ||
|
@@ -103,14 +103,21 @@ curl localhost:9934 | |
yarn build:docker | ||
``` | ||
|
||
4. Run the tests | ||
4. Generate PAPI types for e2e tests | ||
|
||
```bash | ||
yarn generate:papi:e2e | ||
``` | ||
|
||
5. Run the tests | ||
|
||
```bash | ||
yarn test:e2e | ||
``` | ||
|
||
Logs of the application container will be avaiable at `e2e/containter_logs/faucet-test-app.log` | ||
Logs of matrix container will be avaiable at `e2e/containter_logs/faucet-test-matrix.log` | ||
Logs of zombienet nodes will be available at `e2e/zombienet_logs/` | ||
|
||
The whole suite of tests can take tens of seconds, | ||
because it depends on the blockchain to mine blocks and execute the XCM teleportation process. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"relaychain": { | ||
"outputFolder": "src/test/codegen", | ||
"metadata": "e2e/relaychain.scale" | ||
}, | ||
"parachain": { | ||
"outputFolder": "src/test/codegen", | ||
"metadata": "e2e/parachain.scale" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.