Skip to content

Commit 3c285d4

Browse files
author
Damon Chen
committed
Update test_expansion
1 parent ffa5c96 commit 3c285d4

File tree

4 files changed

+80
-11
lines changed

4 files changed

+80
-11
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cronos_777-1:
2+
cmd: cronosd
3+
start-flags: "--trace"
4+
app-config:
5+
minimum-gas-prices: 5000000000000basetcro
6+
json-rpc:
7+
address: "0.0.0.0:{EVMRPC_PORT}"
8+
ws-address: "0.0.0.0:{EVMRPC_PORT_WS}"
9+
validators:
10+
- coins: 1000000000000000000stake,10000000000000000000000basetcro
11+
staked: 1000000000000000000stake
12+
mnemonic: ${VALIDATOR1_MNEMONIC}
13+
- coins: 1000000000000000000stake,10000000000000000000000basetcro
14+
staked: 1000000000000000000stake
15+
mnemonic: ${VALIDATOR2_MNEMONIC}
16+
accounts:
17+
- name: community
18+
coins: 10000000000000000000000basetcro
19+
mnemonic: ${COMMUNITY_MNEMONIC}
20+
- name: signer1
21+
coins: 20000000000000000000000basetcro
22+
mnemonic: ${SIGNER1_MNEMONIC}
23+
- name: signer2
24+
coins: 30000000000000000000000basetcro
25+
mnemonic: ${SIGNER2_MNEMONIC}
26+
27+
genesis:
28+
consensus_params:
29+
block:
30+
max_bytes: "1048576"
31+
max_gas: "81500000"
32+
app_state:
33+
evm:
34+
params:
35+
evm_denom: basetcro
36+
cronos:
37+
params:
38+
cronos_admin: ${CRONOS_ADMIN}
39+
enable_auto_deployment: true
40+
ibc_cro_denom: ${IBC_CRO_DENOM}
41+
gov:
42+
voting_params:
43+
voting_period: "10s"
44+
deposit_params:
45+
max_deposit_period: "10s"
46+
min_deposit:
47+
- denom: "basetcro"
48+
amount: "1"
49+
transfer:
50+
params:
51+
receive_enabled: true
52+
send_enabled: true

integration_tests/test_expansion/test_expansion.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,26 @@
77

88

99
def test_expansion():
10-
template_with_dotenv = Path(__file__).parent / "template_with_dotenv.yaml"
11-
template_no_dotenv = Path(__file__).parent / "template_no_dotenv.yaml"
10+
cronos_has_dotenv = Path(__file__).parent / "cronos_has_dotenv.yaml"
11+
cronos_no_dotenv = Path(__file__).parent / "cronos_no_dotenv.yaml"
12+
cronos_has_posix_no_dotenv = (
13+
Path(__file__).parent / "cronos_has_posix_no_dotenv.yaml"
14+
)
1215

1316
# `expand_yaml` is backward compatible, not expanded, and no diff
14-
assert yaml.safe_load(open(template_no_dotenv)) == expand_yaml(
15-
template_no_dotenv, None
16-
)
17+
assert yaml.safe_load(open(cronos_no_dotenv)) == expand_yaml(cronos_no_dotenv, None)
1718

1819
# `expand_yaml` is expanded but no diff
1920
assert not DeepDiff(
20-
yaml.safe_load(open(template_no_dotenv)),
21-
expand_yaml(template_with_dotenv, None),
21+
yaml.safe_load(open(cronos_no_dotenv)),
22+
expand_yaml(cronos_has_dotenv, None),
2223
ignore_order=True,
2324
)
2425

2526
# overriding dotenv with relative path is expanded and has diff)
2627
assert DeepDiff(
27-
yaml.safe_load(open(template_no_dotenv)),
28-
expand_yaml(template_with_dotenv, ".env1"),
28+
yaml.safe_load(open(cronos_no_dotenv)),
29+
expand_yaml(cronos_has_dotenv, ".env1"),
2930
ignore_order=True,
3031
) == {
3132
"values_changed": {
@@ -40,8 +41,8 @@ def test_expansion():
4041

4142
# overriding dotenv with absolute path is expanded and has diff
4243
assert DeepDiff(
43-
yaml.safe_load(open(template_no_dotenv)),
44-
expand_yaml(template_with_dotenv, os.path.abspath("test_expansion/.env1")),
44+
yaml.safe_load(open(cronos_no_dotenv)),
45+
expand_yaml(cronos_has_dotenv, os.path.abspath("test_expansion/.env1")),
4546
ignore_order=True,
4647
) == {
4748
"values_changed": {
@@ -53,3 +54,19 @@ def test_expansion():
5354
}
5455
}
5556
}
57+
58+
# overriding dotenv with absolute path is expanded and no diff
59+
# If the `.env` changes, it may impact the test result
60+
assert not DeepDiff(
61+
yaml.safe_load(open(cronos_no_dotenv)),
62+
expand_yaml(cronos_has_posix_no_dotenv, os.path.abspath("../scripts/.env")),
63+
ignore_order=True,
64+
)
65+
66+
# overriding dotenv with absolute path is expanded and no diff
67+
# If the `.env` changes, it may impact the test result
68+
assert not DeepDiff(
69+
yaml.safe_load(open(cronos_no_dotenv)),
70+
expand_yaml(cronos_has_dotenv, os.path.abspath("../scripts/.env")),
71+
ignore_order=True,
72+
)

0 commit comments

Comments
 (0)