Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oversize committed Nov 13, 2023
1 parent 81bfdaa commit 770bb06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
2 changes: 2 additions & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest
pytest-cov
4 changes: 3 additions & 1 deletion src/blockperf/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ def logevents_logfile(self):
new_lines = fp.readlines()
# Create logevents from lines
logevents = map(
lambda line: LogEvent.from_logline(line, self.start_time),
lambda line: LogEvent.from_logline(
line, self.app_config.masked_addresses, self.start_time
),
new_lines,
)
# Filter out None's
Expand Down
18 changes: 0 additions & 18 deletions src/blockperf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,6 @@ def node_service_unit(self) -> str:
def max_concurrent_blocks(self) -> int:
return int(self.active_slot_coef) * 3600

@property
def sample_logdir() -> Union[Path, None]:
_sample_logdir := os.getenv("BLOCKPERF_SAMPLE_LOGDIR", self.config_parser.get(
"DEFAULT",
"sample_logdir",
fallback=None,
))

if not _sample_logdir:
return None

_sample_logdir_path = Path(_sample_logdir)
if not _sample_logdir_path.exists():
return None

return _sample_logdir_path


@property
def masked_addresses(self) -> list:
_masked_addresses = os.getenv("BLOCKPERF_MASKED_ADDRESSES", None)
Expand Down

0 comments on commit 770bb06

Please sign in to comment.