-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from oasisprotocol/andrew7234/item-analyzer-r…
…egression-tests testing: extend regression tests to item analyzers
- Loading branch information
Showing
31 changed files
with
1,947 additions
and
62 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
analysis: | ||
source: | ||
cache: | ||
cache_dir: tests/e2e_regression/rpc-cache | ||
query_on_cache_miss: false | ||
chain_name: mainnet | ||
nodes: | ||
damask: | ||
default: { rpc: unix:/tmp/node.sock } | ||
fast_startup: true | ||
analyzers: | ||
# metadata_registry: | ||
# interval: 5m | ||
# node_stats: {} | ||
# aggregate_stats: {} | ||
consensus: | ||
from: 8_048_956 # Damask genesis | ||
to: 8_049_056 # 100 blocks; fast enough for early testing | ||
emerald: | ||
from: 1_003_298 # round at Damask genesis | ||
to: 1_003_598 | ||
# sapphire: | ||
# from: 0 # first round in Damask | ||
storage: | ||
backend: postgres | ||
endpoint: postgresql://rwuser:password@localhost:5432/indexer?sslmode=disable | ||
DANGER__WIPE_STORAGE_ON_STARTUP: true | ||
migrations: file://storage/migrations | ||
|
||
server: | ||
chain_name: mainnet | ||
endpoint: localhost:8008 | ||
storage: | ||
endpoint: postgresql://api:password@localhost:5432/indexer?sslmode=disable | ||
backend: postgres | ||
|
||
log: | ||
level: debug | ||
format: json | ||
|
||
metrics: | ||
pull_endpoint: localhost:8009 |
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,41 @@ | ||
analysis: | ||
source: | ||
cache: | ||
cache_dir: tests/e2e_regression/rpc-cache | ||
query_on_cache_miss: false | ||
chain_name: mainnet | ||
nodes: | ||
damask: | ||
default: { rpc: unix:/tmp/node.sock } | ||
fast_startup: true | ||
analyzers: | ||
# metadata_registry: | ||
# interval: 5m | ||
# node_stats: {} | ||
# aggregate_stats: {} | ||
# consensus: | ||
# from: 8_048_956 # Damask genesis | ||
# to: 8_049_056 # 100 blocks; fast enough for early testing | ||
# emerald: | ||
# from: 1_003_298 # round at Damask genesis | ||
# to: 1_003_598 | ||
# sapphire: | ||
# from: 0 # first round in Damask | ||
evm_tokens_emerald: | ||
stop_on_empty_queue: true | ||
evm_token_balances_emerald: | ||
stop_on_empty_queue: true | ||
evm_contract_code_emerald: | ||
stop_on_empty_queue: true | ||
storage: | ||
backend: postgres | ||
endpoint: postgresql://rwuser:password@localhost:5432/indexer?sslmode=disable | ||
# DANGER__WIPE_STORAGE_ON_STARTUP: true | ||
migrations: file://storage/migrations | ||
|
||
log: | ||
level: debug | ||
format: json | ||
|
||
metrics: | ||
pull_endpoint: localhost:8009 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Our e2e regression test runs the analyzer twice in close succession. This is a slightly hacky but | ||
# simple way to ensure block analyzers run first, and non-block analyzers perform EVM queries always | ||
# at the same height, thereby hitting the offline response cache. | ||
# | ||
# This script compares the key parameters of the two config files used in the two runs. If any of | ||
# those parameters differ, it shows the diff and exits with an error. | ||
|
||
# Element of the config files that we'll compare | ||
important_attrs='{"cache": .analysis.source.cache.cache_dir, "chain_name": .analysis.source.chain_name, "db": .analysis.storage.endpoint}' | ||
|
||
# Enables aliases to work in non-interactive shells. | ||
shopt -s expand_aliases | ||
|
||
# A converter whose only dependency is python3, which is likely preinstalled | ||
alias yaml2json="python3 -c 'import sys,yaml,json; print(json.dumps(yaml.safe_load(str(sys.stdin.read()))))'" | ||
|
||
# Compare | ||
cat tests/e2e_regression/e2e_config_1.yml | yaml2json | jq "$important_attrs" > /tmp/e2e_config_1.summary | ||
cat tests/e2e_regression/e2e_config_2.yml | yaml2json | jq "$important_attrs" > /tmp/e2e_config_2.summary | ||
diff /tmp/e2e_config_1.summary /tmp/e2e_config_2.summary || { echo "The two config files for e2e tests differ in key parameters! See diff above."; exit 1; } |
34 changes: 34 additions & 0 deletions
34
tests/e2e_regression/expected/emerald_account_with_evm_token.body
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,34 @@ | ||
{ | ||
"address": "oasis1qpwx3ptmvcceqkd4syjmqf9jmdlf90xmuuy0f6y9", | ||
"address_preimage": { | ||
"address_data": "Utw6hind6cMAHNjmGTAcsO9qrmI=", | ||
"context": "oasis-runtime-sdk/address: secp256k1eth", | ||
"context_version": 0 | ||
}, | ||
"balances": [], | ||
"evm_balances": [ | ||
{ | ||
"balance": "61055757056562273564127", | ||
"token_contract_addr": "oasis1qpgcp5jzlgk4hcenaj2x82rqk8rrve2keyuc8aaf", | ||
"token_contract_addr_eth": "0x21C718C22D52d0F3a789b752D4c2fD5908a8A733", | ||
"token_decimals": 18, | ||
"token_name": "Wrapped ROSE", | ||
"token_symbol": "wROSE", | ||
"token_type": "ERC20" | ||
}, | ||
{ | ||
"balance": "39480182353477716916987", | ||
"token_contract_addr": "oasis1qqed7mp902c0n76h5tk4k3fgu3vnhd5yhql4482n", | ||
"token_contract_addr_eth": "0xBC033203796CC2C8C543a5aAe93a9a643320433D", | ||
"token_decimals": 18, | ||
"token_name": "ValleySwap Token", | ||
"token_symbol": "VS", | ||
"token_type": "ERC20" | ||
} | ||
], | ||
"stats": { | ||
"num_txns": 10, | ||
"total_received": "0", | ||
"total_sent": "0" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
tests/e2e_regression/expected/emerald_account_with_rose.headers
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,6 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/json | ||
Vary: Origin | ||
Date: UNINTERESTING | ||
Content-Length: UNINTERESTING | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.