Skip to content

Commit 26ce72e

Browse files
authored
test_: option to use custom waku fleet (#6484)
* feat_: add waku fleet configuration options * docs_: waku fleet options in tests * fix_: lint
1 parent 4b276b3 commit 26ce72e

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

tests-functional/README.MD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ Functional tests for status-go
4141
* In `./tests-functional/tests` directory run `pytest -m rpc`
4242
* To run tests against binary run `pytest -m <your mark> --status_backend_url=http://<binary_url>:<binary_port>`
4343

44+
### Options
45+
46+
#### Running with a custom Waku fleet
47+
48+
By default, `status-backend` will use a hard-coded list of supported fleets, and select `status.prod` by default. Functional tests provide 2 options to ask status-go to use a different Waku fleet.
49+
50+
- Use `--waku-fleets-config` to override the list of supported fleets. \
51+
The value will be passed to `InitializeApplication.wakuFleetsConfigFilePath` parameter.
52+
- Use `--waku-fleet` to select a Waku fleet to be used by `status-go`. \
53+
The value will be passed to all of these parameters:
54+
- `CreateAccount.wakuV2Fleet`
55+
- `RestoreAccount.wakuV2Fleet`
56+
57+
Please refer to the description of these parameters in `stauts-go` for details.
58+
4459
### Prerequisites for Mac OSx users
4560
If you see errors at attempt to run tests, try to run in terminal:
4661
```shell

tests-functional/clients/status_backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def init_status_backend(self):
190190
"logEnabled": True,
191191
"logLevel": "DEBUG",
192192
"apiLogging": True,
193+
"wakuFleetsConfigFilePath": option.waku_fleets_config,
193194
}
194195
return self.api_valid_request(method, data)
195196

@@ -286,7 +287,9 @@ def _create_account_request(self, user, **kwargs):
286287
# Logs config
287288
"logEnabled": True,
288289
"logLevel": "DEBUG",
290+
# Waku config
289291
"wakuV2LightClient": kwargs.get("wakuV2LightClient", False),
292+
"wakuV2Fleet": option.waku_fleet,
290293
}
291294
self._set_networks(data, **kwargs)
292295
data = self._set_proxy_credentials(data)

tests-functional/conftest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ def pytest_addoption(parser):
4141
help="When set, will automatically call Logout() before InitializeApplication()",
4242
default=False,
4343
)
44+
parser.addoption(
45+
"--waku-fleets-config",
46+
action="store",
47+
help="Path to a local JSON file with Waku fleets configuration",
48+
default=None,
49+
)
50+
parser.addoption(
51+
"--waku-fleet",
52+
action="store",
53+
help="Waku fleet to be used",
54+
default=None,
55+
)
4456

4557

4658
@dataclass
@@ -88,6 +100,13 @@ def pytest_configure(config):
88100
option.status_backend_urls = status_backend_url_generator(config)
89101

90102

103+
def pytest_report_header(config):
104+
return [
105+
f"waku fleets config file: {config.option.waku_fleets_config}",
106+
f"waku fleet: {config.option.waku_fleet}",
107+
]
108+
109+
91110
@pytest.fixture(scope="function", autouse=True)
92111
def close_status_backend_containers(request):
93112
yield

0 commit comments

Comments
 (0)