Skip to content

Commit

Permalink
Remove .env file. Simplify env variables passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Jan 10, 2025
1 parent 6b81faa commit 0546ea8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
18 changes: 0 additions & 18 deletions .env

This file was deleted.

8 changes: 8 additions & 0 deletions .github/workflows/check_with_mesh_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,36 @@ jobs:
run: |
python3 ./systemtests/check_with_mesh_cli.py --mode=construction-native --network=testnet
sleep 30
env:
PYTHONPATH: .

- name: check:construction (custom)
run: |
python3 ./systemtests/check_with_mesh_cli.py --mode=construction-custom --network=testnet
sleep 30
env:
PYTHONPATH: .

- name: Generate testdata (setup)
run: |
python3 ./systemtests/generate_testdata_on_network.py setup --network=testnet
env:
USERS_MNEMONIC: ${{ secrets.USERS_MNEMONIC }}
SPONSOR_SECRET_KEY: ${{ secrets.SPONSOR_SECRET_KEY }}
PYTHONPATH: .

- name: Generate testdata (run)
run: |
python3 ./systemtests/generate_testdata_on_network.py run --network=testnet
env:
USERS_MNEMONIC: ${{ secrets.USERS_MNEMONIC }}
SPONSOR_SECRET_KEY: ${{ secrets.SPONSOR_SECRET_KEY }}
PYTHONPATH: .

- name: check:data
run: |
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=testnet
env:
PYTHONPATH: .


9 changes: 6 additions & 3 deletions .github/workflows/check_with_mesh_cli_on_localnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ jobs:
- name: Generate testdata (setup)
run: |
source .env
python3 ./systemtests/generate_testdata_on_network.py setup --network localnet
env:
PYTHONPATH: .

- name: Generate testdata (run)
run: |
source .env
python3 ./systemtests/generate_testdata_on_network.py run --network localnet
env:
PYTHONPATH: .

- name: check:data
run: |
source .env
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=localnet
env:
PYTHONPATH: .

- name: Stop MultiversX localnet
if: success() || failure()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check_with_mesh_cli_on_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ jobs:
python3 ./systemtests/check_with_mesh_cli.py --mode=data --network=mainnet
env:
MAINNET_PROXY_URL: ${{ secrets.MAINNET_PROXY_URL }}
PYTHONPATH: .

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ pip install -r ./requirements-dev.txt --upgrade
Optional: generate sample data (transactions):

```
source .env
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py setup --network testnet
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run --network testnet
```
Expand Down
10 changes: 8 additions & 2 deletions systemtests/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os
from dataclasses import dataclass

# These work fine for localnet:
# https://github.com/multiversx/mx-sdk-testwallets/blob/main/users/alice.pem.
DEFAULT_SPONSOR_SECRET_KEY = "413f42575f7f26fad3317a778771212fdb80245850981e48b58a4f25e344e8f9"
# https://github.com/multiversx/mx-sdk-testwallets/blob/main/users/mnemonic.txt.
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"


@dataclass
class Configuration:
Expand All @@ -23,8 +29,8 @@ class Configuration:
view_url: str
custom_currency_issue_cost: int = 50000000000000000
memento_file: str = ""
sponsor_secret_key: bytes = bytes.fromhex(os.environ.get("SPONSOR_SECRET_KEY", ""))
users_mnemonic: str = os.environ.get("USERS_MNEMONIC", "")
sponsor_secret_key: bytes = bytes.fromhex(os.environ.get("SPONSOR_SECRET_KEY", DEFAULT_SPONSOR_SECRET_KEY))
users_mnemonic: str = os.environ.get("USERS_MNEMONIC", DEFAULT_USERS_MNEMONIC)
num_users: int = 128


Expand Down
4 changes: 4 additions & 0 deletions systemtests/generate_testdata_on_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def main():


def do_setup(args: Any):
print("Phase [setup] started...")

network = args.network
configuration = CONFIGURATIONS[network]
memento = Memento(Path(configuration.memento_file))
Expand All @@ -80,6 +82,8 @@ def do_setup(args: Any):


def do_run(args: Any):
print("Phase [run] started...")

network = args.network
configuration = CONFIGURATIONS[network]
memento = Memento(Path(configuration.memento_file))
Expand Down

0 comments on commit 0546ea8

Please sign in to comment.