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

chore: add ignored service/method combinations in Motoko E2E testing #142

Merged
merged 2 commits into from
Jan 23, 2024
Merged
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
11 changes: 11 additions & 0 deletions e2e/motoko/Main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ shared ({ caller = installer }) actor class Main() {
public shared ({ caller }) func test() : async () {
assert caller == installer;

let ignoredTests : [(EvmRpcCanister.RpcService, Text)] = [
// (`RPC service`, `method`)
(#EthMainnet(#BlockPi), "eth_sendRawTransaction"), // "Private transaction replacement (same nonce) with gas price change lower than 10% is not allowed within 30 sec from the previous transaction."
];

let canisterDetails = [
// (`canister module`, `debug name`, `nodes in subnet`, `expected cycles for JSON-RPC call`)
(EvmRpcCanister, "default", 13, 65_923_200),
Expand Down Expand Up @@ -100,6 +105,12 @@ shared ({ caller = installer }) actor class Main() {
switch result {
case (#Ok(_)) {};
case (#Err(err)) {
for ((ignoredService, ignoredMethod) in ignoredTests.vals()) {
if (service == ignoredService and method == ignoredMethod) {
Debug.print("Ignoring error from " # debug_show ignoredService # " " # ignoredMethod);
return;
};
};
Debug.trap("received error in inconsistent results for " # debug_show service # " " # method # ": " # debug_show err);
};
};
Expand Down