Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tda] add explicit config setting for collecting mock data #335

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tda/config.local.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
collect_mock_data: true

browsers:
- remote: false
browserName: chrome
Expand Down
2 changes: 2 additions & 0 deletions tda/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
collect_mock_data: false

browsers:
- remote: true
browserName: chrome
Expand Down
4 changes: 3 additions & 1 deletion tda/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def param_display(self) -> str:


class Config(NamedTuple):
collect_mock_data: bool
browsers: tuple[Browser, ...]
dsn: str
react_endpoints: tuple[str, ...]
Expand All @@ -68,6 +69,7 @@ def _config() -> Config:
with open(cfg_filename) as f:
contents = yaml.safe_load(f)
return Config(
collect_mock_data=contents['collect_mock_data'],
browsers=tuple(Browser(**d) for d in contents['browsers']),
dsn=contents['dsn'],
react_endpoints=tuple(contents['react_endpoints']),
Expand Down Expand Up @@ -499,7 +501,7 @@ def pytest_runtest_makereport(item, call):
# be "setup", "call", "teardown"
setattr(item, "rep_" + rep.when, rep)

if 'localhost' not in CONFIG.dsn:
if not CONFIG.collect_mock_data:
def final_report():
end_time = get_current_time_iso_utc(adjust_seconds=1)
start = urllib.parse.quote(start_time)
Expand Down
Loading