Skip to content
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

Set up E2E testing #49

Merged
merged 51 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5c0f0fd
Set up E2E testing directory structure
rvanasa Sep 27, 2023
998f12a
Progress
rvanasa Sep 27, 2023
cf33d4e
Progress
rvanasa Sep 27, 2023
fd6f114
Progress
rvanasa Sep 27, 2023
f5217ee
Misc
rvanasa Sep 27, 2023
cbc4508
Update 'HttpOutcallClient' implementation
rvanasa Sep 28, 2023
f2284d4
Include 'cycles' in 'HttpOutcallClient' representation
rvanasa Sep 28, 2023
21ff892
Motoko library implementation progress
rvanasa Sep 28, 2023
65e0ad3
Improve ergonomics in Motoko library
rvanasa Sep 28, 2023
c2d0150
Motoko e2e progress
rvanasa Sep 28, 2023
d85a438
Set up example Motoko function
rvanasa Sep 28, 2023
65e4a1e
Simplify
rvanasa Sep 28, 2023
1c6e9c4
Reformat
rvanasa Sep 28, 2023
7b927e5
Misc
rvanasa Sep 28, 2023
4dd4d87
Return 'text' from 'request' method
rvanasa Sep 28, 2023
972196f
Update API documentation
rvanasa Sep 28, 2023
3e6ef5b
Merge branch 'main' of https://github.com/internet-computer-protocol/…
rvanasa Sep 28, 2023
2e68d9e
Update Cargo.toml
rvanasa Sep 28, 2023
825c446
Adjust Cargo configuration
rvanasa Sep 28, 2023
989a2c0
Remove unused dependencies
rvanasa Sep 28, 2023
6849c1a
Reintroduce HTTP outcall transform method
rvanasa Sep 28, 2023
09c37f3
Pass invalid service host in error variant
rvanasa Sep 28, 2023
f7addb0
Refactor error variant names
rvanasa Sep 28, 2023
091af3b
Refactor transient collection names
rvanasa Sep 28, 2023
44babe7
Simplify auth logic for stable memory debugging methods
rvanasa Sep 28, 2023
9996223
Remove unnecessary clone in transform method
rvanasa Sep 28, 2023
c9fbb85
Misc refactor
rvanasa Sep 28, 2023
5b0c36d
Fix error type in Motoko library
rvanasa Sep 28, 2023
bfd157a
Misc bugfix
rvanasa Sep 28, 2023
b873c59
Remove unused Cargo.lock file
rvanasa Sep 28, 2023
2dcf820
Add E2E testing to CI
rvanasa Sep 28, 2023
0e3db0c
Set up canister dependencies in dfx.json
rvanasa Sep 28, 2023
286b53d
Update Motoko base library version
rvanasa Sep 28, 2023
fc02f04
Rust E2E canister progress
rvanasa Sep 28, 2023
dd60632
Show human-readable canister error message in Rust E2E test
rvanasa Sep 28, 2023
7865dc9
Misc
rvanasa Sep 28, 2023
c4e1fee
Rust E2E test implementation progress
rvanasa Sep 28, 2023
8c1bb12
Update E2E test logic to account for changes in gas price
rvanasa Sep 28, 2023
c5f37d2
Reformat
rvanasa Sep 28, 2023
533abd6
Update CI
rvanasa Sep 28, 2023
cf1433f
Build before running 'cargo fmt'
rvanasa Sep 28, 2023
f3c6bd3
Install Mops dependencies after 'npm install'
rvanasa Sep 28, 2023
7716ce1
Rewrite default provider chain ids in decimal notation
rvanasa Sep 28, 2023
edc77f6
Simplify 'next_provider_id' increment logic
rvanasa Sep 28, 2023
4e21fe7
Update CI
rvanasa Sep 28, 2023
0573c91
Motoko E2E test progress
rvanasa Sep 28, 2023
3d97886
Misc
rvanasa Sep 28, 2023
be6a075
Fix
rvanasa Sep 28, 2023
c96d971
Implement retrying with more cycles in Motoko library
rvanasa Sep 28, 2023
7878b02
Motoko library improvements
rvanasa Sep 28, 2023
8e42acb
Misc
rvanasa Sep 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
96 changes: 64 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:
paths-ignore:
- "README.md"
jobs:
cargo-fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cargo fmt
run: |
rustup component add rustfmt
cargo fmt --all -- --check
# cargo-fmt:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Cargo fmt
# run: |
# rustup component add rustfmt
# cargo fmt --all -- --check

cargo-clippy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,34 +54,34 @@ jobs:
# run: |
# cargo audit || true

cargo-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
# cargo-check:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master

- name: Cargo build
uses: actions-rs/cargo@master
with:
command: check
args: --all-targets
# - name: Cargo build
# uses: actions-rs/cargo@master
# with:
# command: check
# args: --all-targets

cargo-build:
runs-on: ubuntu-latest
needs: cargo-check
steps:
- name: Checkout
uses: actions/checkout@master
# cargo-build:
# runs-on: ubuntu-latest
# # needs: cargo-check
# steps:
# - name: Checkout
# uses: actions/checkout@master

- name: Cargo build
uses: actions-rs/cargo@master
with:
command: build
args: --tests --release
# - name: Cargo build
# uses: actions-rs/cargo@master
# with:
# command: build
# args: --tests --release

cargo-wasm-build:
runs-on: ubuntu-latest
needs: cargo-check
# needs: cargo-check
steps:
- name: Checkout
uses: actions/checkout@master
Expand All @@ -94,7 +94,7 @@ jobs:

cargo-test:
runs-on: ubuntu-latest
needs: cargo-check
# needs: cargo-check
steps:
- name: Checkout
uses: actions/checkout@master
Expand All @@ -113,3 +113,35 @@ jobs:
# run: |
# cargo run > candid/ic_eth_expected.did
# diff candid/ic_eth.did candid/ic_eth_expected.did

e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Install dfx
run: |
wget --output-document install-dfx.sh "https://internetcomputer.org/install.sh"
bash install-dfx.sh < <(yes Y)
rm install-dfx.sh
dfx cache install
echo "$HOME/bin" >> $GITHUB_PATH

- name: Start dfx
run: dfx start --background

- name: Install npm packages
run: npm ci

- name: Deploy
run: dfx deploy

- name: Test (Motoko)
run: dfx canister call e2e_motoko test

- name: Test (Rust)
run: dfx canister call e2e_rust test

- name: Check formatting
run: cargo fmt --all -- --check
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.dfx/
node_modules/
target/
.dfx/
.mops/

/src/declarations
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Confirm the authenticity of a message signed by an Ethereum private key. Check o

Make a request to a Web2 Ethereum node using the caller's URL to an openly available JSON-RPC service, or the caller's URL (including an API key if necessary). No registered API key of the canister is used in this scenario.

request: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (Result<blob, EthRpcError>);
request: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (Result<text, EthRpcError>);

* `source`: Any of the following enum variants:
* `Chain: nat64` The relevant EVM network identifier ([reference list](https://chainlist.org/?testnets=true)).
Expand Down
Loading
Loading