Skip to content

Commit be2c41a

Browse files
Optimize CI workflows.
1 parent ebf8137 commit be2c41a

File tree

6 files changed

+48
-6
lines changed

6 files changed

+48
-6
lines changed

.github/workflows/check_with_mesh_cli.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ jobs:
3131
python3 ./systemtests/check_with_mesh_cli.py --mode=construction-native --network=testnet --shard=0
3232
sleep 30
3333
env:
34+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
3435
PYTHONPATH: .
3536

3637
- name: check:construction (custom)
3738
run: |
3839
python3 ./systemtests/check_with_mesh_cli.py --mode=construction-custom --network=testnet --shard=0
3940
sleep 30
4041
env:
42+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
4143
PYTHONPATH: .
4244

4345
- name: Generate testdata (setup)
@@ -46,6 +48,7 @@ jobs:
4648
env:
4749
USERS_MNEMONIC: ${{ secrets.USERS_MNEMONIC }}
4850
SPONSOR_SECRET_KEY: ${{ secrets.SPONSOR_SECRET_KEY }}
51+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
4952
PYTHONPATH: .
5053

5154
- name: Generate testdata (run)
@@ -57,12 +60,14 @@ jobs:
5760
env:
5861
USERS_MNEMONIC: ${{ secrets.USERS_MNEMONIC }}
5962
SPONSOR_SECRET_KEY: ${{ secrets.SPONSOR_SECRET_KEY }}
63+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
6064
PYTHONPATH: .
6165

6266
- name: check:data
6367
run: |
6468
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet --shard=0 --num-blocks=3000
6569
env:
70+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
6671
PYTHONPATH: .
6772

6873

.github/workflows/regularly_check_devnet.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Regularly check devnet
22

33
on:
4+
pull_request:
45
workflow_dispatch:
56
schedule:
67
- cron: "0 */4 * * *"
@@ -31,16 +32,19 @@ jobs:
3132
run: |
3233
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=devnet --shard=0 --num-blocks=3000
3334
env:
35+
DEVNET_PROXY_URL: ${{ secrets.DEVNET_PROXY_URL }}
3436
PYTHONPATH: .
3537

3638
- name: check:data (shard 1)
3739
run: |
3840
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=devnet --shard=1 --num-blocks=3000
3941
env:
42+
DEVNET_PROXY_URL: ${{ secrets.DEVNET_PROXY_URL }}
4043
PYTHONPATH: .
4144

4245
- name: check:data (shard 2)
4346
run: |
4447
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=devnet --shard=2 --num-blocks=3000
4548
env:
49+
DEVNET_PROXY_URL: ${{ secrets.DEVNET_PROXY_URL }}
4650
PYTHONPATH: .

.github/workflows/regularly_check_mainnet.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Regularly check mainnet
22

33
on:
4+
pull_request:
45
workflow_dispatch:
56
schedule:
67
- cron: "0 */4 * * *"
@@ -31,16 +32,19 @@ jobs:
3132
run: |
3233
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=mainnet --shard=0 --num-blocks=3000
3334
env:
35+
MAINNET_PROXY_URL: ${{ secrets.MAINNET_PROXY_URL }}
3436
PYTHONPATH: .
3537

3638
- name: check:data (shard 1)
3739
run: |
3840
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=mainnet --shard=1 --num-blocks=3000
3941
env:
42+
MAINNET_PROXY_URL: ${{ secrets.MAINNET_PROXY_URL }}
4043
PYTHONPATH: .
4144

4245
- name: check:data (shard 2)
4346
run: |
4447
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=mainnet --shard=2 --num-blocks=3000
4548
env:
49+
MAINNET_PROXY_URL: ${{ secrets.MAINNET_PROXY_URL }}
4650
PYTHONPATH: .

.github/workflows/regularly_check_testnet.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Regularly check testnet
22

33
on:
4+
pull_request:
45
workflow_dispatch:
56
schedule:
67
- cron: "0 */4 * * *"
@@ -31,16 +32,19 @@ jobs:
3132
run: |
3233
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet --shard=0 --num-blocks=3000
3334
env:
35+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
3436
PYTHONPATH: .
3537

3638
- name: check:data (shard 1)
3739
run: |
3840
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet --shard=1 --num-blocks=3000
3941
env:
42+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
4043
PYTHONPATH: .
4144

4245
- name: check:data (shard 2)
4346
run: |
4447
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet --shard=2 --num-blocks=3000
4548
env:
49+
TESTNET_PROXY_URL: ${{ secrets.TESTNET_PROXY_URL }}
4650
PYTHONPATH: .

systemtests/config.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@
77
# https://github.com/multiversx/mx-sdk-testwallets/blob/main/users/mnemonic.txt.
88
DEFAULT_USERS_MNEMONIC = "moral volcano peasant pass circle pen over picture flat shop clap goat never lyrics gather prepare woman film husband gravity behind test tiger improve"
99

10+
DEFAULT_MAINNET_PROXY_URL = "https://gateway.multiversx.com"
11+
DEFAULT_DEVNET_PROXY_URL = "https://devnet-gateway.multiversx.com"
12+
DEFAULT_TESTNET_PROXY_URL = "https://testnet-gateway.multiversx.com"
13+
14+
ENV_SPONSOR_SECRET_KEY = os.environ.get("SPONSOR_SECRET_KEY")
15+
ENV_USERS_MNEMONIC = os.environ.get("USERS_MNEMONIC")
16+
ENV_MAINNET_PROXY_URL = os.environ.get("MAINNET_PROXY_URL")
17+
ENV_DEVNET_PROXY_URL = os.environ.get("DEVNET_PROXY_URL")
18+
ENV_TESTNET_PROXY_URL = os.environ.get("TESTNET_PROXY_URL")
19+
20+
if ENV_SPONSOR_SECRET_KEY:
21+
print("Environment variable SPONSOR_SECRET_KEY is set.")
22+
23+
if ENV_USERS_MNEMONIC:
24+
print("Environment variable USERS_MNEMONIC is set.")
25+
26+
if ENV_MAINNET_PROXY_URL:
27+
print("Environment variable MAINNET_PROXY_URL is set.")
28+
29+
if ENV_DEVNET_PROXY_URL:
30+
print("Environment variable DEVNET_PROXY_URL is set.")
31+
32+
if ENV_TESTNET_PROXY_URL:
33+
print("Environment variable TESTNET_PROXY_URL is set.")
34+
1035

1136
@dataclass
1237
class Configuration:
@@ -27,8 +52,8 @@ class Configuration:
2752
view_url: str
2853
custom_currency_issue_cost: int = 50000000000000000
2954
memento_file: str = ""
30-
sponsor_secret_key: bytes = bytes.fromhex(os.environ.get("SPONSOR_SECRET_KEY", DEFAULT_SPONSOR_SECRET_KEY))
31-
users_mnemonic: str = os.environ.get("USERS_MNEMONIC", DEFAULT_USERS_MNEMONIC)
55+
sponsor_secret_key: bytes = bytes.fromhex(ENV_SPONSOR_SECRET_KEY or DEFAULT_SPONSOR_SECRET_KEY)
56+
users_mnemonic: str = ENV_USERS_MNEMONIC or DEFAULT_USERS_MNEMONIC
3257
num_users_per_shard: int = 16
3358
users_in_projected_shard: bool = False
3459
generate_relayed_v1: bool = False
@@ -44,7 +69,7 @@ class Configuration:
4469
config_file_custom_currencies="systemtests/rosetta_config/mainnet-custom-currencies.json",
4570
num_historical_epochs=1,
4671
observer_url="",
47-
proxy_url=os.environ.get("MAINNET_PROXY_URL", "https://gateway.multiversx.com"),
72+
proxy_url=ENV_MAINNET_PROXY_URL or DEFAULT_MAINNET_PROXY_URL,
4873
activation_epoch_sirius=1265,
4974
activation_epoch_spica=1538,
5075
activation_epoch_relayed_v3=4294967295,
@@ -62,7 +87,7 @@ class Configuration:
6287
config_file_custom_currencies="systemtests/rosetta_config/devnet-custom-currencies.json",
6388
num_historical_epochs=3,
6489
observer_url="",
65-
proxy_url="https://devnet-gateway.multiversx.com",
90+
proxy_url=ENV_DEVNET_PROXY_URL or DEFAULT_DEVNET_PROXY_URL,
6691
activation_epoch_sirius=629,
6792
activation_epoch_spica=2327,
6893
activation_epoch_relayed_v3=2991,
@@ -82,7 +107,7 @@ class Configuration:
82107
config_file_custom_currencies="systemtests/rosetta_config/testnet-custom-currencies.json",
83108
num_historical_epochs=3,
84109
observer_url="",
85-
proxy_url="https://testnet-gateway.multiversx.com",
110+
proxy_url=ENV_TESTNET_PROXY_URL or DEFAULT_TESTNET_PROXY_URL,
86111
activation_epoch_sirius=1,
87112
activation_epoch_spica=33,
88113
activation_epoch_relayed_v3=1182,

systemtests/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
PATH_PROXY_TO_OBSERVER_ADAPTER = PATH_REPOSITORY / "systemtests" / "proxyToObserverAdapter"
77
PORT_ROSETTA = 7091
88
URL_OBSERVER_SURROGATE = "http://localhost:8080"
9-
ADAPTER_DELAY_IN_MILLISECONDS = 50
9+
ADAPTER_DELAY_IN_MILLISECONDS = 5
1010
ADDITIONAL_GAS_LIMIT_FOR_RELAYED_V3 = 50_000
1111
AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS = 1000
1212
AWAITING_PATIENCE_IN_MILLISECONDS = 0

0 commit comments

Comments
 (0)