-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using PAPI for e2e tests #379
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,23 @@ curl localhost:9934 | |
yarn build:docker | ||
``` | ||
|
||
4. Run the tests | ||
4. Generate PAPI types for e2e tests | ||
|
||
```bash | ||
yarn generate:papi:e2e | ||
``` | ||
|
||
These types are generated based on `.scale` files in `e2e/` directory. To regenerate these files using live zombienet nodes, use `papi update --config e2e/polkadot-api-e2e.json` command. | ||
|
||
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,12 @@ | ||
{ | ||
"relaychain": { | ||
"outputFolder": "src/test/codegen", | ||
"wsUrl": "ws://127.0.0.1:9933", | ||
"metadata": "e2e/relaychain.scale" | ||
}, | ||
"parachain": { | ||
"outputFolder": "src/test/codegen", | ||
"wsUrl": "ws://127.0.0.1:9934", | ||
"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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a note about how to obtain the
*.scale
files?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added